How to Write Negative Prompts in FLUX

Amdadul Haque Milon
4 min readSep 4, 2024

--

FLUX, a cutting-edge AI image generation model, has taken the world of digital art by storm. Known for its impressive ability to create high-quality images from text prompts, FLUX has become a favorite among artists and creators. However, one limitation that users have encountered is the lack of support for negative prompts — a feature that allows users to specify what they don’t want in the generated image. This article explores a recent breakthrough in using negative prompts with FLUX, providing a detailed guide on implementation and best practices.

Want to generate realistic images with FLUX now?

Try it out at Anakin AI!

What Are Negative Prompts?

Negative prompts are instructions that tell the AI what not to include in the generated image. This feature is crucial for fine-tuning outputs and avoiding unwanted elements in the final image.

Initially, FLUX was not designed to work with negative prompts or Classifier-Free Guidance (CFG) values other than 1. This limitation restricted users’ ability to refine their outputs effectively.

We Can Use Dynamic Thresholding for Negative Prompts in FLUX

A community-driven solution has emerged, allowing FLUX users to incorporate negative prompts and adjust CFG values. This method, known as “Dynamic Thresholding,” opens up new possibilities for FLUX users.

How Dynamic Thresholding Works

Dynamic Thresholding is a technique that rescales latent values and clamps down extreme values, preventing oversaturation and output collapse when using higher CFG values.

Implementing Dynamic Thresholding in FLUX

To implement this technique, users need to install the sd-dynamic-thresholding extension in their FLUX setup. This can typically be done through ComfyUI or similar interfaces.

Setting Up for Negative Prompts for FLUX

What you need:

  1. FLUX model
  2. ComfyUI or a similar interface
  3. sd-dynamic-thresholding extension

Now Let’s work on this!

  1. Install the sd-dynamic-thresholding extension.
  2. In ComfyUI, add the DynamicThresholdingFull node.
  3. Connect your FLUX model to the input of the DynamicThresholdingFull node.
  4. Link the output to your KSampler’s input.

How to Optimize Dynamic Thresholding Parameters

Basically, you need to take care of these parameters:

  • CFG Scale: Typically set between 3–7. Higher values increase prompt adherence but may lead to oversaturation.
  • Interpolate Phi: Controls image saturation. Values between 0.7–0.9 often yield the best results.
  • Mimic Scale and CFG Mode: “Half Cosine Up” for both parameters has shown to produce optimal results.

While increasing CFG improves prompt adherence, it can slow down generation. Find a balance between CFG and the built-in Flux Guidance Scale for optimal results.

Here are some more tips about CFG values:

  1. Realistic Images: Lower CFG (around 2–3) and reduce Interpolate Phi (0.6–0.7).
  2. Artistic Renderings: Higher CFG (4–6) and increased Interpolate Phi (0.8–0.9).
  3. Abstract Concepts: Experiment with extreme CFG values (7+) but be prepared for more unpredictable results.

Here are some example settings you can use:

CFG Scale: 3

Interpolate Phi: 0.7

Mimic Scale: Half Cosine Up

CFG Mode: Half Cosine Up

How to Write the Best Prompts for FLUX

Most of the negative Prompts from Stable Diffusion works in FLUX. Here is an example:

blurry, oversaturated colors, modern buildings, people, animals other than koi fish, text, logos, watermarks, distorted proportions, unrealistic lighting

It’s always the best to create negative prompts based on the type of images you want to create. For Portrait Photography:

Positive Prompts: Professional portrait of a middle-aged woman with short gray hair, warm smile, and kind eyes. Natural outdoor lighting, shallow depth of field, bokeh background of a park. High-quality DSLR photo, sharp focus on the face.

Negative Prompts: young appearance, long hair, indoor setting, harsh lighting, blurry focus, multiple people, accessories, hats, glasses

Here’s the test result:

You can test it out here at Anakin AI:

How to Write Better FLUX Prompts, Generally

  1. Oversaturation: If images appear too saturated, reduce the Interpolate Phi value.
  2. Lack of Prompt Adherence: Increase CFG scale gradually, but be aware of the performance impact.
  3. Slow Generation: Consider using a lower resolution for initial tests, then scale up for final outputs.
  4. Inconsistent Results: Experiment with different seed values to find optimal starting points.

And you might want to consider these techniques to make your image quality better:

  • LoRA Integration: Combine Dynamic Thresholding with LoRA models for even more precise control.

app.anakin.ai

As the FLUX model continues to evolve, it’s likely that native support for negative prompts and more advanced CFG controls will be integrated. The community-driven solution of Dynamic Thresholding serves as a stepping stone, showcasing the potential for even more powerful and flexible image generation in the future!

--

--

Amdadul Haque Milon
Amdadul Haque Milon

Written by Amdadul Haque Milon

AI enthusiast and content creator. I love breaking down complex AI concepts into easy-to-follow guides, making advanced technology accessible to everyone.

Responses (1)