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

Implement Euler Ancestral Discrete scheduler #34

Merged

Conversation

mspronesti
Copy link
Contributor

Hi @LaurentMazare,
this PR aims at integrating the Euler Ancestral Discrete Scheduler into this repository, solving the second task mentioned in #23 .

It includes all the features implemented in HF's Python version.

All the considerations made in my last PR, regarding the need to generalize the examples, still apply here.

@sssemil
Copy link
Contributor

sssemil commented Jan 8, 2023

image

Tried this with sd1.5 and this prompt:

    "n_steps": 21,
    "seed": 1573789502,
    "prompt": "A rusty robot holding a fire torch.",
    "guidance_scale": 7.5

I think something is wrong here, or in my code.

@mspronesti
Copy link
Contributor Author

Hi @sssemil,
I tried with HF python diffusers, using your same config (expect the seed) and here are some images with different seeds. To me they seem aligned with the one you obtained with my code.

image

image

image

@sssemil
Copy link
Contributor

sssemil commented Jan 8, 2023

Hm, but at the same time, this is what I get with python snippet you wrote in another thread:
image

And this looks better.

@mspronesti
Copy link
Contributor Author

Did you change the scheduler and the number of inference steps (some of those snippets have 1000)? I tried several times with that same snippet and the appropriate scheduler. Here are other examples I just produced

image

image

image

I leave the exact snippet hereby, to make sure we're using the same one

import torch
from diffusers import StableDiffusionPipeline, EulerAncestralDiscreteScheduler

pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16)

pipe.scheduler = EulerAncestralDiscreteScheduler()

pipe = pipe.to("cuda")
prompt = "A very rusty robot holding a fire torch."
image = pipe(prompt, num_inference_steps=21).images[0]  
image

@sssemil
Copy link
Contributor

sssemil commented Jan 8, 2023

I think I ran it with 50 steps before, here's with 21:
image

Welp, then it's similar results.

@mspronesti
Copy link
Contributor Author

Happy to help 👍

@LaurentMazare
Copy link
Owner

Merged, thanks for all the scheduler hard work!

@mspronesti
Copy link
Contributor Author

mspronesti commented Jan 9, 2023

Thanks for merging! (maybe forgot to push after git merge?)

@LaurentMazare LaurentMazare merged commit 7b5b53d into LaurentMazare:main Jan 9, 2023
@LaurentMazare
Copy link
Owner

Oh right sorry about that!

@mspronesti mspronesti deleted the euler-discrete-ancestral branch January 11, 2023 13:02
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

Successfully merging this pull request may close these issues.

None yet

3 participants