Skip to content
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

error using stable diffusion 2 #124

Closed
omidreza-amrollahi opened this issue Dec 6, 2022 · 3 comments
Closed

error using stable diffusion 2 #124

omidreza-amrollahi opened this issue Dec 6, 2022 · 3 comments

Comments

@omidreza-amrollahi
Copy link

Hi, I get an error as below when I try to use stable diffusion 2:

/usr/local/lib/python3.8/dist-packages/diffusers/pipeline_utils.py in from_pretrained(cls, pretrained_model_name_or_path, **kwargs)
672 elif len(missing_modules) > 0:
673 passed_modules = set(list(init_kwargs.keys()) + list(passed_class_obj.keys())) - optional_kwargs
--> 674 raise ValueError(
675 f"Pipeline {pipeline_class} expected {expected_modules}, but only {passed_modules} were passed."
676 )

ValueError: Pipeline <class 'stable_diffusion_videos.stable_diffusion_pipeline.StableDiffusionWalkPipeline'> expected {'safety_checker', 'vae', 'tokenizer', 'unet', 'text_encoder', 'feature_extractor', 'scheduler'}, but only {'vae', 'tokenizer', 'unet', 'text_encoder', 'scheduler'} were passed.

any ideas how it can be solved? Thanks

@nateraw
Copy link
Owner

nateraw commented Dec 6, 2022

I was able to load it like this (using latest version of this library, 0.7.1)

from stable_diffusion_videos import StableDiffusionWalkPipeline
from diffusers import EulerDiscreteScheduler
import torch

model_id = "stabilityai/stable-diffusion-2-base"

# Use the Euler scheduler here instead
scheduler = EulerDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler")
pipe = StableDiffusionWalkPipeline.from_pretrained(
    model_id,
    scheduler=scheduler,
    feature_extractor=None,
    safety_checker=None,
    revision="fp16",
    torch_dtype=torch.float16,
).to("cuda")

@omidreza-amrollahi
Copy link
Author

works! thank you very much. Is there also a way to create videos between two custom images? (rather than images generated by stable diffusion)

@nateraw
Copy link
Owner

nateraw commented Dec 8, 2022

Nope it only works for images generated from the model. You can read a detailed explanation of the logic here in the music videos post to understand why that is.

@nateraw nateraw closed this as completed Dec 12, 2022
seriousran added a commit to seriousran/stable-diffusion-videos that referenced this issue Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants