Repository navigation
FLUX.3 [klein] prompts; edit optimizer sees the pictures - #265
Merged
Merged
Conversation
FLUX.3 [klein] replaces FLUX.2 [klein], Boogu-Image and Qwen-Image as the prompt target: routed models tagged prompt_target "flux3" (and untagged ones) get FLUX.3 captions and edit instructions, Krea 2 keeps its own rules. The draw and edit optimizer prompts follow the official prompt upsampler: medium-first captions with frame-relative layout and quoted text for drawing, "Create a ... preserving the first image as the exact canvas" instructions with picture ordinals for editing, merged with the visual-prompt-expand rules and few-shot examples taken from the flux3-klein-pup-50k dataset. The edit optimizer now sees the pictures the way the upsampler does: the bot downloads them through its Telegram client, resizes them to the upsampler's reference policy (1024², 724² or 512² by count, sides on a multiple of 32, JPEG q92), and sends them before the request with the upsampler's reference order line. Telegram file URLs carry the bot token and never reach the model. When a picture cannot be prepared the optimizer works from the text alone. FLUX.3 outputs get the same corner mark as FLUX.2 outputs.
Owner
Author
|
Both Danger warnings are intentional.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
ImageModelis nowFlux3 | Krea2. A routed model taggedprompt_target: "flux3", or an untagged one, gets FLUX.3 [klein] prompts. Krea 2 keeps its rules. The FLUX.2 [klein], Boogu-Image and Qwen-Image targets are removed, and their tag values now fall back to FLUX.3.prompts/image/optimizer.prompt). The prompt follows the FLUX.3 prompt upsampler: medium-first captions, frame-relative layout, quoted text kept verbatim, 100–350 words. It merges thevisual-prompt-expandrules with the existing request, context, aspect-ratio, NSFW and safety rules. Short or vague requests expand into complete scenes. The few-shot examples are eight text-to-image samples fromflux3-klein-pup-50kacross different domains, plus authored Cyrillic-text, adult and forbidden cases.prompts/image/edit_optimizer.prompt). Instructions use the upsampler's own form: "Create a preserving the first image as the exact canvas, changing only …", with picture ordinals, concrete end states and consequences, operation-specific boundaries and one compact preservation clause. The few-shot examples are nine image-to-image samples from the dataset plus the official two-reference example, with authored adult and forbidden cases.MediaPromptOptimizer::optimize_image_edit_prompttakes image data URLs.OptimizingImageEditorloads the edit's pictures through the bot's Telegram client (image_edit_references.rs). It resizes them to the upsampler's reference policy (1024², 724² or 512² by picture count, sides on a multiple of 32, JPEG q92) and sends them before the request with the upsampler's lineReference images follow in order (…). This works on the OpenAI-compatible path and on the Gemini path.flux3_generateendpoint gets the same corner mark as FLUX.2 outputs.Why
FLUX.3 [klein] (Heretic text encoder, W4A8) replaces Boogu for regular draws and the second VIP slot, and replaces Qwen-Image for VIP edits. FLUX.3 was trained on its upsampler's captions and instructions, and that upsampler sees the reference pictures when it writes an edit.
Verification
cargo fmt --all --checkpasses.cargo clippy --workspace --all-targets -- -D warningspasses.cargo test -p openplotva-media -p openplotva-llm -p openplotva-apppasses: 47, 217 and 1418 tests.