Skip to content

[Sana Sprint] add image-to-image pipeline #11602

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

Merged
merged 70 commits into from
May 27, 2025
Merged

Conversation

linoytsaban
Copy link
Collaborator

@linoytsaban linoytsaban commented May 22, 2025

This PR adds sana sprint image-to-image ⚡️⚡️
@sayakpaul @apolinario

import torch
from diffusers import SanaSprintImg2ImgPipeline
from diffusers.utils.loading_utils import load_image

image = load_image(
    "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/penguin.png"
)

pipe = SanaSprintImg2ImgPipeline.from_pretrained("Efficient-Large-Model/Sana_Sprint_1.6B_1024px_diffusers", torch_dtype=torch.bfloat16)
pipe.to("cuda")

pipe(prompt="a cute pink bear", 
        image=image, 
        strength=0.45, 
        height=832, width=480).images[0]

run time on H100 -

100%
 1/1 [00:00<00:00, 14.24it/s]

download (45)
download (47)

@linoytsaban linoytsaban marked this pull request as ready for review May 22, 2025 09:24
@linoytsaban
Copy link
Collaborator Author

@bot /style

Copy link
Contributor

Style fixes have been applied. View the workflow run here.

@sayakpaul
Copy link
Member

sayakpaul commented May 22, 2025

@linoytsaban could you also update the PR with example code and results? And maybe also comment a bit on the speed repercussions?

Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

Thanks! Left some comments. Also, I think we need to add to docs.

@linoytsaban linoytsaban requested a review from sayakpaul May 26, 2025 09:33
@linoytsaban
Copy link
Collaborator Author

@bot /style

Copy link
Contributor

Style fixes have been applied. View the workflow run here.

@linoytsaban
Copy link
Collaborator Author

@bot /style

Copy link
Contributor

Style fixes have been applied. View the workflow run here.

@linoytsaban linoytsaban merged commit 28ef016 into huggingface:main May 27, 2025
12 checks passed
@linoytsaban linoytsaban deleted the sana branch May 27, 2025 19:10
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.

3 participants