Skip to content

Conversation

@patrickvonplaten
Copy link
Contributor

@patrickvonplaten patrickvonplaten commented Nov 2, 2023

What does this PR do?

This PR cleans the LCM pipeline and scheduler and also adds LCM Img2Img to "main" as well as the auto pipeline.

The following now works:

from diffusers import AutoPipelineForText2Image, AutoPipelineForImage2Image
import torch

pipe = AutoPipelineForText2Image.from_pretrained("SimianLuo/LCM_Dreamshaper_v7", revision="c4c79506b49efd22e0cd254ec4092ab3d7d8ae52", local_files_only=True)

prompt = "A beautiful landscape of a snowy mountain"

num_inference_steps = 2

image = pipe(prompt=prompt, num_inference_steps=num_inference_steps, output_type="pil").images[0]
image.save("snow_mountain.png")

pipe = AutoPipelineForImage2Image.from_pipe(pipe)

prompt = "A beautiful landscape of a very red mountain"

image = pipe(prompt=prompt, image=image, num_inference_steps=4, output_type="pil").images[0]
image.show()

cc @vladmandic

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Nov 2, 2023

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

@patrickvonplaten patrickvonplaten changed the title Correct lcm [LCM] Make sure img2img works Nov 2, 2023
@patrickvonplaten patrickvonplaten merged commit 072e008 into main Nov 2, 2023
@patrickvonplaten patrickvonplaten deleted the correct_lcm branch November 2, 2023 18:52
@vladmandic
Copy link
Contributor

thanks for really quick turnaround.
btw, from_single_file for LCM is not implemented?

ValueError: Unhandled pipeline class: LatentConsistencyModelPipeline

@sayakpaul
Copy link
Member

btw, from_single_file for LCM is not implemented?

Not yet.

kashif pushed a commit to kashif/diffusers that referenced this pull request Nov 11, 2023
* [LCM] Clean up implementations

* Add all

* correct more

* correct more

* finish

* up

batch_size = batch_size * num_images_per_prompt

if image.shape[1] == 4:

Choose a reason for hiding this comment

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

What is the reason for this special case?

yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
* [LCM] Clean up implementations

* Add all

* correct more

* correct more

* finish

* up
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
* [LCM] Clean up implementations

* Add all

* correct more

* correct more

* finish

* up
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.

6 participants