Skip to main content
FluxPipeline provides support for multiple image generation pipelines with and without controlnets, including text-to-image (txt2img), image-to-image (img2img), and inpainting.
Ensure that a volume mount is added to the deployment, as all images generated are dumped inside /data/outputs directory in the container.

Model Optimization Configuration

Optimization Settings

For optimization, under the optimization config, use:
  • Higher threshold values result in greater speed gains but may degrade image generation accuracy.
  • We recommend a threshold of 0.1, which can provide up to a 40% speed improvement during inference while maintaining reasonable quality.

Pipeline Settings

For optimization, under the optimization config, use:
  • Multiple ControlNet models can be added under the controlnets section.
  • Each ControlNet model requires a name, source, and authentication details if needed.
Here are some key pointers for understanding and structuring controlnet requests:

Understanding ControlNet Parameters

ControlNet Name Convention:

  • The parameters follow a structured pattern:
  • Example for Canny:
  • Example for Depth:

Extensibility for Multiple ControlNets:

  • This pattern allows easy extension to additional ControlNet models in a structured way.
  • If you add a new ControlNet (e.g., OpenPose), you’d include:

How Weightage Works::

  • Each weightage parameter (canny_weightage, depth_weightage, etc.) determines the degree of influence that specific ControlNet has on the final image.
  • Higher values make the model adhere more strictly to the control image, potentially sacrificing flexibility.
  • Lower values allow more artistic freedom but reduce adherence to structured inputs.

Combining Multiple ControlNets:

  • You can combine multiple ControlNets in a single request to layer different structural constraints.
  • In this example:
    • Canny edge detection helps maintain sharp edges in the image.
    • Depth estimation preserves 3D structural information.
    • By adjusting the weightages, you can balance between these two influences.

Generalized Pattern for Other ControlNets:

  • Example with Pose and Normal Map:

Supported Pipelines

  1. txt2img - Generates an image from text input.
  2. txt2img_controlnet - Generates an image from text input with controlnet support.
  3. img2img - Generates an image based on an input image and a given prompt.
  4. img2img_controlnet - Generates an image based on an input image and a given prompt with controlnet support.
  5. inpaint - Modifies specific regions of an image based on a mask and a given prompt.
  6. inpaint_controlnet - Modifies specific regions of an image based on a mask and a given prompt with controlnet support.

Example Requests

txt2img

txt2img_controlnet

img2img

img2img_controlnet

inpaint

inpaint_controlnet

Example Response

Key Notes

  • Ensure volume mounting in deployment for image storage.
  • ControlNet models are not loaded by default.
  • Supports multiple pipelines for text-to-image, image-to-image, and inpainting.