Description
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
Prompt: A painting by Picasso of Hatsune Miku in an office. Desk, window, books. / Seed: 9119
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