Skip to content

Conversation

@patrickvonplaten
Copy link
Contributor

This PR adds a pipeline that supports k-diffusion

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Nov 21, 2022

The documentation is not available anymore as the PR was closed or merged.

@patrickvonplaten patrickvonplaten merged commit 182eb95 into main Nov 21, 2022
@patrickvonplaten patrickvonplaten deleted the add_k_diffusion_pipeline branch November 21, 2022 17:45
Comment on lines +710 to +728
![diffusers_euler](https://huggingface.co/datasets/patrickvonplaten/images/resolve/main/k_diffusion/astronaut_euler.png)

**K Diffusion**:
```python
from diffusers import DiffusionPipeline, EulerDiscreteScheduler

seed = 33

pipe = DiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", custom_pipeline="sd_text2img_k_diffusion")
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config)
pipe = pipe.to("cuda")

pipe.set_sampler("sample_euler")
generator = torch.Generator(device="cuda").manual_seed(seed)
image = pipe(prompt, generator=generator, num_inference_steps=50).images[0]
```

![diffusers_euler](https://huggingface.co/datasets/patrickvonplaten/images/resolve/main/k_diffusion/astronaut_euler_k_diffusion.png)

Copy link

@pingren pingren Nov 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @patrickvonplaten

I can't tell the visual difference of generated images in this README example:

diffusers_euler

diffusers_euler with k-diffusion

I suppose there would be something different to compare?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @pingren,

All I wanted to show here is that it "works" 😅

Copy link

@pingren pingren Nov 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw this PR in v0.8 a release notes and want to see what's the new k-diffusion, and it confuses me by showing “almost identical” results of K-diffusion and original diffusion.

Do you like the idea to tweak the parameters and show the difference? Reduce steps from 50 to 20 will show visual differences significantly.

CleanShot 2022-11-30 at 12 02 11

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.

4 participants