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.63k stars 2.43k forks source link

[bug]: switching models produces corrupt images #6854

Open grunblatt-git opened 1 month ago

grunblatt-git commented 1 month ago

Is there an existing issue for this problem?

Operating system

macOS

GPU vendor

Apple Silicon (MPS)

GPU model

No response

GPU VRAM

No response

Version number

5.0.0.a5

Browser

Chrome

Python dependencies

No response

What happened

When switching between different checkpoints invoke starts to produce corrupt images.

Here is an example of a corrupt image. Below is the image that invoke produced after restarting (same settings & same seed)

a460558f-0667-4e2e-86da-693b74c2b061 1cb59056-7f81-4ada-963e-a3ba7226a223

What you expected to happen

Switching to different checkpoints should not negatively impact the generation process. I.e. generating an image after switching between checkpoints several times should produce the same output as generating an image with the same settings right after starting up invoke

How to reproduce the problem

Start up invoke and queue up images. They can use the exact same settings and prompt, but each image should be generated with a different checkpoint.

After generating 3-5 images (this number might be hardware dependant) invoke starts to output corrupt images exclusively. Every generation, even with checkpoints that worked well before, produces images that look like noise.

Some more examples:

2aa7f516-4e1b-4efe-ae11-34fbc5c7b609 2f9a1977-5af8-4791-9608-70c7bd7fa11e 4e5f6425-2443-469f-83d5-4467b73d05eb 0590729f-f25f-4409-9746-a85341117b83 a460558f-0667-4e2e-86da-693b74c2b061

Additional context

Rolling back to version 4.2.7 fixes this issue. I can reproduce this error since version 4.2.8

Generating several images with the same checkpoint works fine in all versions.

Discord username

No response

psychedelicious commented 1 month ago

Thanks for confirming when the issue began. Strangely we haven't had other users mention this to my knowledge.

Can you please share the hardware and macOS info from Apple Icon -> About This Mac?

This info: image

Ty

grunblatt-git commented 1 month ago

I ran into this with SD 1.5 on an Intel Mac:

Chip: 2,3 GHz 8-Core Intel Core i9 GPU: Intel UHD Graphics 630 1536 MB Memory: 32 GB 2667 MHz DDR4 MacOS: Sonoma 14.6.1

grunblatt-git commented 4 weeks ago

The Release Notes for 5.1.1 mentioned a similar issue for XL models.

I tried the suggested workaround of adding attention_type: torch-sdp to the invoke.yaml. However this does not seem to affect the behavior described above. With both settings I keep getting corrupt images consistently when switching models.