KnoBuddy / VisualDiffusion

A GUI for text2img diffusion, as a visual alternative to CLI and Jupyter Notebooks.
MIT License
28 stars 3 forks source link

[BUG] The prompt frame does not appear #17

Closed tuwonga closed 2 years ago

tuwonga commented 2 years ago

Describe the bug The gui starts but in the window there's no prompt frame

If I click on "New Prompt" this is the error : Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\Shutonga\miniconda3\envs\prs\lib\tkinter\__init__.py", line 1883, in __call__ return self.func(*args) File "visualdiffusion\prsgui.py", line 491, in new_prompt prompt[len(prompt_list)-1].set(prompt_entry[len(prompt_list)-2].get()) KeyError: -1

I closed the gui and started again so I tried to click on "Save". This is the error: Traceback (most recent call last): File "C:\Users\Shutonga\miniconda3\envs\prs\lib\tkinter\__init__.py", line 1883, in __call__ return self.func(*args) File "visualdiffusion\prsgui.py", line 201, in <lambda> save_button = ttk.Button(basic_buttons_frame, text='Save', command=lambda: save_prompts(True)) File "visualdiffusion\prsgui.py", line 443, in save_prompts json_set = {'prompt': prompt_list[0], 'batch_name': batch_name, 'width': width, 'height': height, 'steps': steps, 'scale': scale, 'seed': seed, 'n_batches': n_batches, 'n_iter': n_iter, 'init_image': init_image, 'init_strength': init_strength, 'gobig_maximize': gobig_maximize, 'gobig_overlap': gobig_overlap, 'method': method, 'eta': eta, 'from_file': from_file, 'cool_down': cool_down, 'use_jpg': use_jpg, 'gobig': gobig, 'variance': variance, 'frozen_seed': frozen_seed, 'save_settings': save_settings} KeyError: 0

I was really surpeised when I didn't found the Prompt form because I installed visualdiffusion gui on progrockdiffusion and it works pretty well. please forgive me if I made mistakes in filling the BUG issue form but first time for me on GitHub Thank you. 55ec6e66-58a5-4c20-87c5-2631bade63e7

KnoBuddy commented 2 years ago

I actually already have this fixed in my local files. I have a few other features that have been added I was testing, and hopefully they don't break anything else. I will upload it today.

KnoBuddy commented 2 years ago

I assume you have tried to click new prompt?

tuwonga commented 2 years ago

I assume you have tried to click new prompt?

yes I did

I wrote : If I click on "New Prompt" this is the error : Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\Shutonga\miniconda3\envs\prs\lib\tkinter__init.py", line 1883, in call__ return self.func(*args) File "visualdiffusion\prsgui.py", line 491, in new_prompt prompt[len(prompt_list)-1].set(prompt_entry[len(prompt_list)-2].get()) KeyError: -1

KnoBuddy commented 2 years ago

Please update. It should be fixed.

tuwonga commented 2 years ago

Please update. It should be fixed.

I did the update by "git pull" restarted prsgui.py and this is the error :

`Parsing settings.json Applying settings file: settings.json Using k_lms sampling method. Loading the model and checkpoint (./models/sd-v1-4.ckpt)... Loading model from ./models/sd-v1-4.ckpt LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 859.52 M params. making attention of type 'vanilla' with 512 in_channels Working with z of shape (1, 4, 32, 32) = 4096 dimensions. making attention of type 'vanilla' with 512 in_channels Traceback (most recent call last): File "C:\Users\Shutonga\miniconda3\envs\prs\lib\site-packages\transformers\configuration_utils.py", line 650, in _get_config_dict config_dict = cls._dict_from_json_file(resolved_config_file) File "C:\Users\Shutonga\miniconda3\envs\prs\lib\site-packages\transformers\configuration_utils.py", line 734, in _dict_from_json_file return json.loads(text) File "C:\Users\Shutonga\miniconda3\envs\prs\lib\json__init__.py", line 357, in loads return _default_decoder.decode(s) File "C:\Users\Shutonga\miniconda3\envs\prs\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\Shutonga\miniconda3\envs\prs\lib\json\decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 88 column 3 (char 2317)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "prs.py", line 1067, in main() File "prs.py", line 939, in main model = load_model_from_config(config, f"{ckpt}", verbose=False) File "prs.py", line 74, in load_model_from_config model = instantiate_from_config(config.model) File "C:\Users\Shutonga\prs\ldm\util.py", line 85, in instantiate_from_config return get_obj_from_str(config["target"])(config.get("params", dict())) File "C:\Users\Shutonga\prs\ldm\models\diffusion\ddpm.py", line 461, in init self.instantiate_cond_stage(cond_stage_config) File "C:\Users\Shutonga\prs\ldm\models\diffusion\ddpm.py", line 519, in instantiate_cond_stage model = instantiate_from_config(config) File "C:\Users\Shutonga\prs\ldm\util.py", line 85, in instantiate_from_config return get_obj_from_str(config["target"])(config.get("params", dict())) File "C:\Users\Shutonga\prs\ldm\modules\encoders\modules.py", line 142, in init self.transformer = CLIPTextModel.from_pretrained(version) File "C:\Users\Shutonga\miniconda3\envs\prs\lib\site-packages\transformers\modeling_utils.py", line 1764, in from_pretrained config, model_kwargs = cls.config_class.from_pretrained( File "C:\Users\Shutonga\miniconda3\envs\prs\lib\site-packages\transformers\models\clip\configuration_clip.py", line 126, in from_pretrained config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, kwargs) File "C:\Users\Shutonga\miniconda3\envs\prs\lib\site-packages\transformers\configuration_utils.py", line 553, in get_config_dict config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, kwargs) File "C:\Users\Shutonga\miniconda3\envs\prs\lib\site-packages\transformers\configuration_utils.py", line 652, in _get_config_dict raise EnvironmentError( OSError: It looks like the config file at 'C:\Users\Shutonga/.cache\huggingface\transformers\9c24e6cd9f499d02c4f21a033736dabd365962dc80fe3aeb57a8f85ea45a20a3.26fead7ea4f0f843f6eb4055dfd25693f1a71f3c6871b184042d4b126244e142' is not a valid JSON file.`

tuwonga commented 2 years ago

the start but prompt form is missing (+ error)

KnoBuddy commented 2 years ago

The second issue was a huggingface issue that was temporary for this morning. Should be fixed.

I have also updated VisualDiffusion and added a new file, makegudpics.py. Please test it out and let me know what you think!

(Closing this. Let me know if you have more issues.)

tuwonga commented 2 years ago

Thank you. with makegudpics.py the GUI created (by clicking SAVE button) the gui_settings.json so now also prsgui.py is running ! you are great, thank you for patience ^^