Skip to content

Conversation

sayakpaul
Copy link
Member

What does this PR do?

As the title goes.

Next plan is to incorporate these changes in #12269.

I tested with the code snippet from #12419 (comment).

For img2img, I did:

import torch 
from diffusers import ModularPipeline
from diffusers.utils import load_image

repo_id = "black-forest-labs/FLUX.1-dev"

pipe = ModularPipeline.from_pretrained(repo_id)
pipe.load_components(torch_dtype=torch.bfloat16)
pipe = pipe.to("cuda")
# print(pipe)

url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"
init_image = load_image(url).resize((1024, 1024))

output = pipe(
    prompt="a dog sitting by the see waiting for its companion to come",
    image=init_image,
    guidance_scale=3.5,
    num_inference_steps=28,
    max_sequence_length=512,
    strength=0.95,
    generator=torch.manual_seed(0)
)
output.values["images"][0].save("modular_flux_image.png")

@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.

Copy link
Member

@asomoza asomoza left a comment

Choose a reason for hiding this comment

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

LGTM, it also fixed the issue I was having with the nodes!

@sayakpaul sayakpaul merged commit 2dc3167 into main Oct 8, 2025
16 of 17 checks passed
@sayakpaul sayakpaul deleted the flux-modular-followup branch October 8, 2025 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants