> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# FLUX 3.1 Image in ComfyUI: 4K Text to Image and Bounding-Box Edits

> Run FLUX 3.1 Image in ComfyUI for 4K text to image, instruction edits, masks, and bounding-box edits, in fast or quality mode.

FLUX 3.1 Image is Black Forest Labs' photoreal image model, available in ComfyUI as a Partner Node. It generates an image from a prompt or edits one you supply, and accepts up to 10 reference images, or 9 with a mask, and boxes from **Create Bounding Boxes**. Three templates cover text to image, instruction edit, and bounding-box edit.

## What FLUX 3.1 Image is good at

* **Text to image**: renders a prompt at sixteen aspect ratios and resolutions from 1K to 4K
* **Instruction edits**: describe one change and keep the rest of the photo as it is
* **Many references**: up to 10 images, or 9 when a mask is connected, addressed as `image 1`, `image 2`, and so on
* **Masks**: white areas may change, black areas stay untouched
* **Boxes**: place an object or a line of text where you draw it, up to 32 boxes
* **Quality or fast mode**: `quality` is better at text, many references and fine detail, `fast` costs less
* **Grounding**: `auto` searches the web when the prompt names a real place or product

## Use it

> [card] [Call it from code](https://docs.comfy.org/development/comfy-router/models/black-forest-labs/flux-3-1-image/code.md)
>
> Call it over HTTP through Comfy Router, with copy-paste Python, TypeScript, Swift and cURL snippets

This node runs through the Black Forest Labs API, so it needs a Comfy account with credits and downloads no local model. The Router call bills the same credits. See [Partner Nodes pricing](https://docs.comfy.org/tutorials/partner-nodes/pricing.md) for per-image rates and [Concurrency limits](https://docs.comfy.org/tutorials/partner-nodes/concurrency-limits.md) for how many requests you can have in flight.

> [!TIP]
>
> To use the Partner Nodes, you need to ensure that you are logged in properly and using a permitted network environment. Please refer to the [Partner Nodes Overview](https://docs.comfy.org/tutorials/partner-nodes/overview.md) section of the documentation to understand the specific requirements for using the Partner Nodes.

> [!TIP]
>
> > [tab] Local users
> >
> > Make sure your ComfyUI is updated.
> >
> > * [Download ComfyUI](https://www.comfy.org/download)
> > * [Update Guide](https://docs.comfy.org/installation/update_comfyui.md)
> >
> > Workflows in this guide can be found in the [Workflow Templates](https://docs.comfy.org/interface/features/template.md).
> > If you can't find them in the template, your ComfyUI may be outdated.
> >
> > If nodes are missing when loading a workflow, possible reasons:
> >
> > 1. You are not using the latest ComfyUI version (Nightly version)
> > 2. Some nodes failed to import at startup
>
> > [tab] Cloud users
> >
> > * [Cloud](https://cloud.comfy.org) will update after ComfyUI stable release.
> >
> > So, if you find any core node missing in this document, it might be because the new core nodes have not yet been released in the latest stable version. Please wait for the next stable release.

## Text to image

Generate an image from a prompt. No input files are required.

![FLUX 3.1 Image text to image workflow](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/api_bfl_flux3_1_t2i-1.webp)

> [card] [Download Workflow](https://github.com/Comfy-Org/workflow_templates/blob/main/templates/api_bfl_flux3_1_t2i.json)
>
> Download JSON or search "FLUX 3.1 Image: Text to Image" in Template Library

1. Write the prompt in the **FLUX 3.1 Image** node
2. Set `mode` to `quality` or `fast`, then pick a `resolution` from 1K to 4K
3. Leave `aspect_ratio` on `auto` unless you want a specific frame, and `grounding` on `auto`
4. Click **Queue**

## Instruction edit

Describe one change and say what must stay. The node expands the prompt and repaints what you describe; anything you leave unnamed can change too.

![FLUX 3.1 Image instruction edit workflow](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/api_bfl_flux3_1_image_edit-1.webp)

> [card] [Download Workflow](https://github.com/Comfy-Org/workflow_templates/blob/main/templates/api_bfl_flux3_1_image_edit.json)
>
> Download JSON or search "FLUX 3.1 Image: Image Edit" in Template Library

<details>
  <summary>Input materials</summary>

  Download this sample photo to try the workflow:

  > [card] [Input image](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/fashion_model_orange_beaded_shirt.png)
  >
  > Download sample input image
</details>

1. Load your photo into `image_1`, and add references with the Autogrow slots, up to 10, or 9 when a mask is connected
2. Name each connected image in the prompt as `image 1`, `image 2`, and so on
3. State the change, then close with what must stay: "keep her face and the shirt exactly as they are". Anything you do not name can be repainted
4. The template sets both `aspect_ratio` and `resolution` to `match image 1`, which keeps the framing and size of `image 1`. That input must be at least 0.25 megapixels and no wider than 8:1, and anything above 4096x4096 is reduced first, so prepare a supported input before chaining edits
5. Click **Queue**

## Bounding-box edit

Draw a box over the area to change and describe what happens inside it. Boxes tell the model where to place something; they do not clip the frame, so light and shadows outside a box can still shift.

![FLUX 3.1 Image bounding box edit workflow](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/api_bfl_flux3_1_image_bboxes-1.webp)

> [card] [Download Workflow](https://github.com/Comfy-Org/workflow_templates/blob/main/templates/api_bfl_flux3_1_image_bboxes.json)
>
> Download JSON or search "FLUX 3.1 Image: Bounding Box Edit" in Template Library

<details>
  <summary>Input materials</summary>

  Download this sample photo to try the workflow:

  > [card] [Input image](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/woman_with_flower_swim_shot.png)
  >
  > Download sample input image
</details>

1. Load the photo into `image_1`
2. Draw boxes in **Create Bounding Boxes** and write the change into each box's description. Describe background boxes first and foreground boxes last
3. Set the canvas width and height in **Create Bounding Boxes** to the aspect ratio of the output. The box grid stretches with the frame, so a mismatched canvas puts boxes in the wrong place
4. Write the overall rule in the prompt, for example "change only what the boxes describe, keep everything else as it is". The node reads the boxes as `<box_1>`, `<box_2>`, in row order
5. Click **Queue**

A box you click without dragging has zero size, so the node expands it to 10% of the frame in each collapsed direction. Give a new element a box you actually drag. To change several things, draw several boxes. When the pixels around the box must stay exactly as they are, connect a mask with the edit area in white and the surrounding pixels in black.

## Get started

1. Update ComfyUI to the latest version (0.47.2 or later)
2. Open the Template Library and search for `FLUX 3.1 Image`
3. Drag a template onto the canvas, replace the sample input if it has one, then click **Queue**


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.