diff --git a/extensions/sd_api_pictures/script.py b/extensions/sd_api_pictures/script.py index 4fc0a08d..78488cd0 100644 --- a/extensions/sd_api_pictures/script.py +++ b/extensions/sd_api_pictures/script.py @@ -10,6 +10,7 @@ import requests import torch from PIL import Image +from modules import shared from modules.models import reload_model, unload_model from modules.ui import create_refresh_button diff --git a/modules/chat.py b/modules/chat.py index c08f3f3f..c0635c23 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -294,12 +294,12 @@ def generate_chat_reply(text, state, regenerate=False, _continue=False, loading_ def generate_chat_reply_wrapper(text, start_with, state, regenerate=False, _continue=False): if start_with != '' and not _continue: if regenerate: - text = remove_last_message() + text, state['history'] = remove_last_message(state['history']) regenerate = False _continue = True - send_dummy_message(text) - send_dummy_reply(start_with) + send_dummy_message(text, state) + send_dummy_reply(start_with, state) for i, history in enumerate(generate_chat_reply(text, state, regenerate, _continue, loading_message=True)): yield chat_html_wrapper(history, state['name1'], state['name2'], state['mode'], state['chat_style']), history