FLUX 3.1 Image
Edit and control
FLUX 3.1 Image supports multiple ways to edit and guide outputs, from written instructions and painted masks to multi-reference inputs and bounding boxes.
generate() helper. Set resolution and aspect_ratio to match_first_image to keep the input image’s dimensions.Choosing an edit control
Painted masks
Pass a black-and-whitemask matching the aspect ratio of images[0] when you need pixels outside a fixed boundary locked identically to images[0]. White marks what can change, black is composited verbatim from images[0], and gray values linearly alpha-blend original and edited pixels.Leave enough white padding for larger replacements, cast shadows, and reflections, and keep gray to narrow edge feathering—wide gray transition bands alpha-blend original and edited pixels and will ghost overhanging changes. If the new object or its shadow needs room to grow outside the old object’s footprint, use an unmasked instruction edit or bounding boxes instead.Pass a hosted mask URL directly into mask (or base64 PNG):Python
No mask file yet? Build a mask PNG in Python (Pillow)
No mask file yet? Build a mask PNG in Python (Pillow)
Python
Multi-reference
Send up to 10 images inimages and refer to them in your prompt as image 1, image 2, and so on.Put your main scene first so aspect_ratio: "auto" or "match_first_image" inherits its framing.Instruction edits
Passimages with a direct written instruction to restyle an image, wrap artwork onto a product, or update text and weather. For local changes, name both what changes and what stays fixed:Keep exploring
Bounding boxes
Draw boxes in Box Studio and run chained layout-to-edit workflows.
API reference
Full request schema, field constraints, and response codes.
Overview
Quickstart client, sizing options, 4K zoom inspector, and web grounding.
Editing prompting guide
Prompt patterns for single-reference and multi-reference edits.

