-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[regression] StableDiffusionPipeline.from_single_file() does not handle SD 1.5 models with prediction_type v_prediction
#9171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@lstein Can you share the image outputs from v0.29.2 and v0.30.0? |
By any chance do you have |
My bad. The regression is present in 0.29.2 as well. The previous working version was 0.27.0. I have amended the bug report. Here is the output from the script run with diffusers 0.27.0 vs 0.30.0. Also note the difference in image size. 0.27.0 apparently thinks this is an sd-2 model. |
Indeed yes. I've seen that |
Hi @lstein yes, we updated single file to rely on the model cache/configs to set up the pipleines. It enables us to support single file on a larger range for models. The I noticed that the scheduler in the repo you linked does contain a config that sets from diffusers import StableDiffusionPipeline
import torch
model_id = 'https://huggingface.co/zatochu/EasyFluff/blob/main/EasyFluffV11.safetensors'
pipe = StableDiffusionPipeline.from_single_file(
model_id,
config="zatochu/EasyFluff",
torch_dtype=torch.float16,
).to("cuda")
prompt = "banana sushi"
image = pipe(prompt, num_inference_steps=25).images[0]
image.save("sushi.png") |
I'm a developer of InvokeAI, and am trying to support users who import arbitrary |
In most cases we can auto match to the appropriate config, provided that the In this particular case you're setting the You could configure a scheduler before hand with prediction type and set it in the pipeline. e.g from diffusers import StableDiffusionPipeline, DDIMScheduler
ckpt_path = "https://huggingface.co/zatochu/EasyFluff/blob/main/EasyFluffV11.safetensors"
pipe = StableDiffusionPipeline.from_single_file(ckpt_path)
pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config, prediction_type="v_prediction")
print(pipe.scheduler.config.prediction_type)
Do you happen to have a list of models that would need to support these arbitrary |
the yaml file does specify the should we consider adding a special check for this config when a yaml is passed? I think this is really an edge case where a fine-tuned checkpoint can have a different configuration from the base checkpoint |
Ah my bad. Missed that. But even in earlier versions, we relied on the
In the current version, setting via
The reasoning was to encourage setting the prediction type via the Scheduler object and passing that object to the pipeline. Like we do for |
@lstein |
PR to address the current issue: #9229 |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
Closing since #9229 was merged to fix the issue. |
Describe the bug
There are a few Stable Diffusion 1.5 models that use a prediction type of
v_prediction
rather thanepsilon
. In version 0.27.0,StableDiffusionPipeline.from_single_file()
correctly detected and rendered images from such models. However, in version 0.30.0, these models are always treated asepsilon
, even when the correctprediction_type
andoriginal_config
arguments are set.Reproduction
You will need to download the original config file, EasyFluffV11.yaml into the current directory for this to work. After running, the file
sushi.png
will show incorrect rendering.Logs
The text was updated successfully, but these errors were encountered: