lllyasviel / stable-diffusion-webui-forge

GNU Affero General Public License v3.0
8.55k stars 838 forks source link

Issue with refiner activated with SDXL #2356

Open Arnaud3013 opened 1 day ago

Arnaud3013 commented 1 day ago

Just using last forge version, with highres+refiner and script xyz for changing checkpoint. No error without refiner activated. image image

 80%|#################################################################6                | 32/40 [00:21<00:05,  1.50it/s]
Model selected: {'checkpoint_info': {'filename': 'C:\\Test\\stable-diffusion-webui\\models\\Stable-diffusion\\SDXL\\copaxTimelessxl_xiii.safetensors', 'hash': 'fcdfe4db'}, 'additional_modules': [], 'unet_storage_dtype': None}
Using online LoRAs in FP16: False
generating image for xyz plot: AssertionError
Traceback (most recent call last):
  File "C:\Test\stable-diffusion-webui-forge\scripts\xyz_grid.py", line 752, in cell
    res = process_images(pc)
  File "C:\Test\stable-diffusion-webui-forge\modules\processing.py", line 842, in process_images
    res = process_images_inner(p)
  File "C:\Test\stable-diffusion-webui-forge\modules\processing.py", line 990, in process_images_inner
    samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts)
  File "C:\Test\stable-diffusion-webui-forge\modules\processing.py", line 1428, in sample
    return self.sample_hr_pass(samples, decoded_samples, seeds, subseeds, subseed_strength, prompts)
  File "C:\Test\stable-diffusion-webui-forge\modules\processing.py", line 1532, in sample_hr_pass
    samples = self.sampler.sample_img2img(self, samples, noise, self.hr_c, self.hr_uc, steps=self.hr_second_pass_steps or self.steps, image_conditioning=image_conditioning)
  File "C:\Test\stable-diffusion-webui-forge\modules\sd_samplers_kdiffusion.py", line 188, in sample_img2img
    samples = self.launch_sampling(t_enc + 1, lambda: self.func(self.model_wrap_cfg, xi, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
  File "C:\Test\stable-diffusion-webui-forge\modules\sd_samplers_common.py", line 278, in launch_sampling
    return func()
  File "C:\Test\stable-diffusion-webui-forge\modules\sd_samplers_kdiffusion.py", line 188, in <lambda>
    samples = self.launch_sampling(t_enc + 1, lambda: self.func(self.model_wrap_cfg, xi, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
  File "C:\Test\stable-diffusion-webui-forge\venv\lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)
  File "C:\Test\stable-diffusion-webui-forge\k_diffusion\sampling.py", line 595, in sample_dpmpp_2m
    denoised = model(x, sigmas[i] * s_in, **extra_args)
  File "C:\Test\stable-diffusion-webui-forge\venv\lib\site-packages\torch\nn\modules\module.py", line 1553, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\Test\stable-diffusion-webui-forge\venv\lib\site-packages\torch\nn\modules\module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\Test\stable-diffusion-webui-forge\modules\sd_samplers_cfg_denoiser.py", line 171, in forward
    if sd_samplers_common.apply_refiner(self, x):
  File "C:\Test\stable-diffusion-webui-forge\modules\sd_samplers_common.py", line 197, in apply_refiner
    sd_models.forge_model_reload()
  File "C:\Test\stable-diffusion-webui-forge\venv\lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)
  File "C:\Test\stable-diffusion-webui-forge\modules\sd_models.py", line 504, in forge_model_reload
    sd_model = forge_loader(state_dict, additional_state_dicts=additional_state_dicts)
  File "C:\Test\stable-diffusion-webui-forge\venv\lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)
  File "C:\Test\stable-diffusion-webui-forge\backend\loader.py", line 287, in forge_loader
    component = load_huggingface_component(estimated_config, component_name, lib_name, cls_name, local_path, component_sd)
  File "C:\Test\stable-diffusion-webui-forge\backend\loader.py", line 61, in load_huggingface_component
    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!

Traceback (most recent call last):
  File "C:\Test\stable-diffusion-webui-forge\modules_forge\main_thread.py", line 30, in work
    self.result = self.func(*self.args, **self.kwargs)
  File "C:\Test\stable-diffusion-webui-forge\modules\txt2img.py", line 128, in txt2img_function
    processed = modules.scripts.scripts_txt2img.run(p, *p.script_args)
  File "C:\Test\stable-diffusion-webui-forge\modules\scripts.py", line 792, in run
    processed = script.run(p, *script_args)
  File "C:\Test\stable-diffusion-webui-forge\scripts\xyz_grid.py", line 793, in run
    processed = draw_xyz_grid(
  File "C:\Test\stable-diffusion-webui-forge\scripts\xyz_grid.py", line 366, in draw_xyz_grid
    process_cell(x, y, z, ix, iy, iz)
  File "C:\Test\stable-diffusion-webui-forge\scripts\xyz_grid.py", line 330, in process_cell
    processed: Processed = cell(x, y, z, ix, iy, iz)
  File "C:\Test\stable-diffusion-webui-forge\scripts\xyz_grid.py", line 776, in cell
    grid_infotext[subgrid_index] = processing.create_infotext(pc, pc.all_prompts, pc.all_seeds, pc.all_subseeds)
  File "C:\Test\stable-diffusion-webui-forge\modules\processing.py", line 741, in create_infotext
    firstpass_use_distilled_cfg_scale = getattr(p,'firstpass_use_distilled_cfg_scale', p.sd_model.use_distilled_cfg_scale)
AttributeError: 'NoneType' object has no attribute 'use_distilled_cfg_scale'
'NoneType' object has no attribute 'use_distilled_cfg_scale'