Skip to content

Proposal to add sigmas option to FluxPipeline #10080

Closed
@John6666cat

Description

@John6666cat

Is your feature request related to a problem? Please describe.
Flux's image generation is great, but it seems to have a tendency to remove too much detail.

Describe the solution you'd like.
Add the sigmas option to FluxPipeline to enable adjustment of the degree of noise removal.

Additional context.
I propose adding the sigmas option to FluxPipeline.
The details are as follows.

Yntec picked up a FLUX modification proposal from Reddit, and r3gm, the author of stablepy, wrote the code for the logic part of the FLUX pipeline modification, and I made a demo by making a test commit on github, and it turned out that it was working as expected.

This time, we only modified the pipeline for T2I for testing. During discussions with r3gm, it was discovered that the sigmas option, which exists in StableDiffusionXLPipeline, does not exist in FluxPipeline, so the actual implementation was switched to porting the sigmas option.
Also, in the current FluxPipeline, I also found a bug where specifying timesteps would probably result in an error because sigmas are hard-coded, even though the SDXL pipeline code is reused, so I fixed it while I was at it.

If you want to use Reddit's suggested 0.95, specify it as follows.

factor = 0.95
sigmas = np.linspace(1.0, 1 / num_inference_steps, num_inference_steps)
sigmas = sigmas * factor

image_sigmas = pipe(
        prompt=prompt,
        guidance_scale=guidance_scale,
        num_inference_steps=num_inference_steps,
        width=width,
        height=height,
        generator=generator,
        output_type="pil",
        sigmas=sigmas
    ).images[0]

I will post some samples that were actually generated in the demo.

Prompt: anthropomorphic pig Programmer with laptop, colorfull, funny / Seed: 9119
pig

Prompt: A painting by Picasso of Hatsune Miku in an office. Desk, window, books. / Seed: 9119
miku

Prompt: 80s cinematic colored sitcom screenshot. young husband with wife. festive scene at a copper brewery with a wooden keg of enjoying burrito juice in the center. sitting cute little daughter. Display mugs of dark beer. Closeup. beautiful eyes. accompanied by halloween Shirley ingredients. portrait smile / Seed: 9119
family

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions