lllyasviel / stable-diffusion-webui-forge

GNU Affero General Public License v3.0
8.11k stars 795 forks source link

Hiresfix for flux gives me this 'NoneType' object has no attribute 'sd_checkpoint_info' #2136

Open DarkViewAI opened 2 days ago

DarkViewAI commented 2 days ago

AttributeError: 'NoneType' object has no attribute 'sd_checkpoint_info' Time taken: 0.0 sec.

assert isinstance(state_dict, dict) and len(state_dict) > 16, 'You do not have CLIP state dict!'

AssertionError: You do not have CLIP state dict! [Unload] Trying to free all memory for cuda:0 with 0 models keep loaded ... Done. Traceback (most recent call last): File "D:\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui-forge\modules_forge\main_thread.py", line 30, in work self.result = self.func(*self.args, *self.kwargs) File "D:\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui-forge\modules\txt2img.py", line 125, in txt2img_function processed = processing.process_images(p) File "D:\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui-forge\modules\processing.py", line 840, in process_images res = process_images_inner(p) File "D:\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui-forge\modules\processing.py", line 877, in process_images_inner p.sd_model_name = shared.sd_model.sd_checkpoint_info.name_for_extra 'NoneType' object has no attribute 'sd_checkpoint_info' AttributeError: 'NoneType' object has no attribute 'sd_checkpoint_info' Traceback (most recent call last): File "D:\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui-forge\modules_forge\main_thread.py", line 30, in work 'NoneType' object has no attribute 'sd_checkpoint_info' self.result = self.func(self.args, **self.kwargs) File "D:\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui-forge\modules\txt2img.py", line 125, in txt2img_function processed = processing.process_images(p) File "D:\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui-forge\modules\processing.py", line 840, in process_images res = process_images_inner(p) File "D:\StabilityMatrix-win-x64\Data\Packages\stable-diffusion-webui-forge\modules\processing.py", line 877, in process_images_inner p.sd_model_name = shared.sd_model.sd_checkpoint_info.name_for_extra AttributeError: 'NoneType' object has no attribute 'sd_checkpoint_info'

zappityzap commented 2 days ago

Seems to be caused by commit aaa2fe7 from #2116. The version before it works for me. @DenOfEquity

DenOfEquity commented 2 days ago

If the model you use for the highresfix pass requires additional modules (VAE, CLIP, T5) you need to specify them. (if the first pass model also used them, you can set 'Use same choices', not empty selection). The only way I've been able to induce a similar error is by not providing the necessary modules. I've tested, for example:

zappityzap commented 1 day ago

Thanks, I was using Flux dev with separate modules. I didn't have hires_fix_show_sampler enabled, so those options weren't showing up for me. It's working fine after enabling that setting.

DenOfEquity commented 1 day ago

You have exposed a bug too, so thanks for your comments. The default for hires checkpoint and modules is to use the first pass settings, but that didn't happen in your case. I think the issue came from imprecise handling of infotext (settings taken from images or the blue arrow button), incorrectly clearing the Hires VAE / Text Encoder; so I've patched that. I also wonder if these selections should always be visible now (instead of behind an option), as Flux has made them more important.