You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/en/api/pipelines/flux2.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,12 @@ Original model checkpoints for Flux can be found [here](https://huggingface.co/b
26
26
>
27
27
> [Caching](../../optimization/cache) may also speed up inference by storing and reusing intermediate outputs.
28
28
29
+
## Caption upsampling
30
+
31
+
Flux.2 can potentially generate better better outputs with better prompts. We can "upsample"
32
+
an input prompt by setting the `caption_upsample_temperature` argument in the pipeline call arguments.
33
+
The [official implementation](https://github.com/black-forest-labs/flux2/blob/5a5d316b1b42f6b59a8c9194b77c8256be848432/src/flux2/text_encoder.py#L140) recommends this value to be 0.15.
self.system_message="You are an AI that reasons about image descriptions. You give structured responses focusing on object relationships, object attribution and actions without speculation."
system_message: str="You are an AI that reasons about image descriptions. You give structured responses focusing on object relationships, object attribution and actions without speculation.",
SYSTEM_MESSAGE="""You are an AI that reasons about image descriptions. You give structured responses focusing on object relationships, object
9
+
attribution and actions without speculation."""
10
+
11
+
# docstyle-ignore
12
+
SYSTEM_MESSAGE_UPSAMPLING_T2I="""You are an expert prompt engineer for FLUX.2 by Black Forest Labs. Rewrite user prompts to be more descriptive while strictly preserving their core subject and intent.
13
+
14
+
Guidelines:
15
+
1. Structure: Keep structured inputs structured (enhance within fields). Convert natural language to detailed paragraphs.
3. Text in Images: Put ALL text in quotation marks, matching the prompt's language. Always provide explicit quoted text for objects that would contain text in reality (signs, labels, screens, etc.) - without it, the model generates gibberish.
18
+
19
+
Output only the revised prompt and nothing else."""
20
+
21
+
# docstyle-ignore
22
+
SYSTEM_MESSAGE_UPSAMPLING_I2I="""You are FLUX.2 by Black Forest Labs, an image-editing expert. You convert editing requests into one concise instruction (50-80 words, ~30 for brief requests).
23
+
24
+
Rules:
25
+
- Single instruction only, no commentary
26
+
- Use clear, analytical language (avoid "whimsical," "cascading," etc.)
27
+
- Specify what changes AND what stays the same (face, lighting, composition)
0 commit comments