invoke-ai / InvokeAI

Invoke is a leading creative engine for Stable Diffusion models, empowering professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry leading WebUI, and serves as the foundation for multiple commercial products.
https://invoke-ai.github.io/InvokeAI/
Apache License 2.0
23.41k stars 2.41k forks source link

[bug]: Error with starter model dreamshaper 8 and certain schedulers #6368

Open psychedelicious opened 5 months ago

psychedelicious commented 5 months ago

Is there an existing issue for this problem?

Operating system

Linux

GPU vendor

Nvidia (CUDA)

GPU model

No response

GPU VRAM

24

Version number

4.2.1

Browser

FF

Python dependencies

No response

What happened

When using the starter model dreamshaper 8 (or dreamshaper 8 inpainting) and some schedulers, generation fails during denoising.

Only these schedulers trigger the error:

[2024-05-15 08:41:36,681]::[InvokeAI]::ERROR --> Error while invoking session 7c0fe7a9-5eab-454e-877c-98802fec7854, invocation 08dbe0a3-30d8-4da7-a510-a5ac52264c8e (denoise_latents):
`final_sigmas_type` zero is not supported for `algorithm_type` deis. Please choose `sigma_min` instead.
[2024-05-15 08:41:36,681]::[InvokeAI]::ERROR --> Traceback (most recent call last):
  File "/home/bat/Documents/Code/InvokeAI/invokeai/app/services/session_processor/session_processor_default.py", line 185, in _process
    outputs = self._invocation.invoke_internal(
  File "/home/bat/Documents/Code/InvokeAI/invokeai/app/invocations/baseinvocation.py", line 281, in invoke_internal
    output = self.invoke(context)
  File "/home/bat/Documents/Code/InvokeAI/.venv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/home/bat/Documents/Code/InvokeAI/invokeai/app/invocations/latent.py", line 948, in invoke
    scheduler = get_scheduler(
  File "/home/bat/Documents/Code/InvokeAI/invokeai/app/invocations/latent.py", line 313, in get_scheduler
    scheduler = scheduler_class.from_config(scheduler_config)
  File "/home/bat/Documents/Code/InvokeAI/.venv/lib/python3.10/site-packages/diffusers/configuration_utils.py", line 259, in from_config
    model = cls(**init_dict)
  File "/home/bat/Documents/Code/InvokeAI/.venv/lib/python3.10/site-packages/diffusers/configuration_utils.py", line 653, in inner_init
    init(self, *args, **init_kwargs)
  File "/home/bat/Documents/Code/InvokeAI/.venv/lib/python3.10/site-packages/diffusers/schedulers/scheduling_dpmsolver_multistep.py", line 268, in __init__
    raise ValueError(
ValueError: `final_sigmas_type` zero is not supported for `algorithm_type` deis. Please choose `sigma_min` instead.

The starter models tab installs a diffusers version of the affected models. When using the checkpoint version of this model, there is no error.

What you expected to happen

All the schedulers work.

How to reproduce the problem

No response

Additional context

No response

Discord username

No response

Vargol commented 4 months ago

I'd guess it's picking up algorithm-type 'deis' from the default scheduler for the model which is DEISMultistepScheduler, and using that in the scheduler config for the DPM schedulers. DEISMultistepScheduler however doesn't have a final_sigmas_type parameter so it's using the default 'zero' value for final_sigmas_type from the DPM schedulers which is not compatible with the deis algorithm type.

It's probably going to need a check for this in the code which picks other f the values to change (algorithm type would seem most sensible to me, so DPM using its default value) unless the InvokeAI team give us a way of changing the scheduler parameters.

Earnest-Williams commented 4 months ago

Just confirming that this is happening with dreamshaper 9 inpaint and the Orthodox Christian Iconography LoRA if you wanna test. https://civitai.com/models/146025/orthodox-christian-iconography-artstyle-lora