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

Open
wants to merge 38 commits into
base: main
Choose a base branch
from

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
Copy link
Collaborator Author

@bot /style

Copy link
Contributor

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

@linoytsaban linoytsaban requested a review from sayakpaul May 22, 2025 15:35
@sayakpaul sayakpaul requested a review from yiyixuxu May 23, 2025 02:56
@sayakpaul
Copy link
Member

Cc: @asomoza for testing (if you want to).

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.

Good to merge after adding a test.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

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