Repository navigation
FLUX 3 Image Klein onboarding (distilled core) - #930
Merged
Merged
Conversation
Launch-day audit of the vendor and diffusers sources, and the design for the distilled core: probes P1/P2 on lem (bf16 fits 24 GB at 1024^2 with every component placed; the pup runs through text_generation but needs enable_thinking off), and the from_hub system-prompt reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mages A Qwen3.5 upsampler must run with enable_thinking off, an edit sends every reference, and a pinned prompt wants pinned weights. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… commit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…template_kwargs Workflows are untrusted and the settings are splatted into the pipeline and apply_chat_template calls, so images/tools/etc. would reach transformers unvalidated. Also pins that image list elements get the URL check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…only, size cap Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… file anonymously A full commit is answered from the local cache without an auth check, so token=False alone left cached gated files readable. Ask the Hub first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The skill picks among the five FLUX 3 Klein templates by request shape, states the 16-step no-guidance schedule, the 16-pixel grid, the 4096 ceiling as stated rather than checked, and the 10-reference training limit the pipeline does not enforce. Prompts go through the upsampler builtins, or BFL's prompting guide for hand-written captions; the box format is in references/layout-boxes.md. Named in the plugin README and CLAUDE.md; the tests read the step default off the distilled denoise block. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The edit templates always re-upsample and take no caption, so a corrected caption is reused through a one-step workflow built from the edit template's Klein step, not by passing prompt= or falling back to text-to-image. dw's reference sizing for the upsampler is not BFL's, so BFL's budget is no longer quoted. One memory figure for Apple Silicon, the guidance rule as BFL's reference code states it, and CLAUDE.md rewrapped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… unsized from_hub generate_kwargs reached model.generate() unfiltered, so an untrusted workflow could set custom_generate (transformers downloads and runs the repo's custom_generate/generate.py) with trust_remote_code, or pass tokenizer_encode_kwargs around the chat_template_kwargs checks. - dw/trust.py: require_trusted_generate_arguments refuses custom_generate and trust_remote_code unless workflows are trusted - generate_kwargs: the call's structural keys are refused on both paths, and values must be scalars or lists of scalars; all checked before any load - _RESERVED_CHAT_TEMPLATE_KEYS gains the calls' remaining named parameters - system_prompt.from_hub refuses a file the Hub reports no size for Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…age need - text-to-image, upsample-then-generate and the README declare only the multiple-of-16 rule; BFL's 64 to 4096 range is stated as not checked - flux3_klein_upsample_edit says at least one image is required, and what an empty list produces - tests: flux3 step-cache rows in alphabetical order; the upsample step's result is asserted to be an intermediate Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… built - TASKS.md: chat_template_kwargs and generate_kwargs filtering, the custom_generate/trust_remote_code trust rule, and that an image list is one prompt with one answer (also for judge and image_to_text) - SECURITY.md and ARCHITECTURE.md: the generate_kwargs gate and the anonymous, pinned, fail-closed from_hub fetch - Klein design spec: from_hub asks the Hub before every use and fails closed offline; the 10-reference cap is stated, not enforced; follow-ups for the other tasks' generate_kwargs and revision validation parity Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
Decisions needed from @dkackman
Rulings made during implementationEach line gives the ruling, then what it costs if wrong.
🤖 Generated with Claude Code |
… 3 Klein (#930) Approved by Don 2026-10-15: measured 11_256 with the five Klein templates, about 85 tokens held for the Task 9 cost blocks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…xtures Brings test_dw_patch_targets back under the ratchet for #930. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dkackman
added a commit
that referenced
this pull request
Oct 16, 2026
…low-ups The text_generation fixture refactor in #930 removed 44 patch sites. The plan lists what develop still owes: the remaining generate()/detector kwargs splats, Klein Tasks 9 and 11 on lem, the downloads_required and update_diffusers gaps, #928, and the 0.14.0 release body. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dkackman
added a commit
that referenced
this pull request
Oct 18, 2026
Both reach model.generate() for a generative text-to-audio model, where custom_generate / trust_remote_code download and run Hub code. Untrusted workflows now get the same refusal text_generation does (#930), before the model loads; each block must be an object. Open in every release through 0.14.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
Adds FLUX 3 Image Klein (
black-forest-labs/flux-3-image-klein, distilled, released 2026-10-15) to the catalog. It includes BFL's prompt upsampler as a pinned prior step, theflux3-kleinplugin skill, and the model-agnostictext_generationoptions the upsampler needs. Running the templates requires diffusers at or after 7ecb1e1b (PR #15046, not yet released).Audit:
docs/proposals/audits/2026-10-15-flux-3-klein-audit.md. Design:docs/superpowers/specs/2026-10-15-flux-3-klein-catalog-design.md. Plan:docs/superpowers/plans/2026-10-15-flux3-klein-catalog.md.Engine (
dw/tasks/text_generation.py, nothing model-specific)chat_template_kwargstakes scalar values only; the pipeline's andapply_chat_template's own argument names are refused. The upsampler needsenable_thinking: false.revisionpins the model weights.imagemay be a list. Each element goes through the existing URL and path validation.system_promptcan be{"from_hub": {repo, file, revision, key}}, so a vendor's prompt file is read at a pinned commit instead of being copied into the repo. The revision must be a full 40-hex commit. The repo and file go through the shared validators. Before every use the file is checked anonymously with the Hub, and the check fails closed, so a gated or private file the server has cached is never readable. It is downloaded withtoken=Falseand capped at 1 MiB.generate_kwargswas passed togenerate()unfiltered. An untrusted workflow could setcustom_generate+trust_remote_codeand run code from any Hub repo. Those two keys now require trusted workflows (dw/trust.py). Structural keys and non-scalar values are refused.Catalog
flux3_klein_upsampleandflux3_klein_upsample_editrunflux-3-image-klein-pup, with weights and system prompts both pinned at 3f3edb52.workflows/templates/flux3/: text-to-image, upsample-then-generate, image-edit, multi-reference and layout-boxes. They use BFL's own example captions, images and seeds. A model entry,workflows/models/flux3-klein.json, and a family README are included._execution_deviceon the CPU, which breaks both the encode and the noise draw.plugins/dw/skills/flux3-klein/.Measured on lem (RTX 3090, bf16, everything resident)
text_generationenable_thinkingis offStill open before merge
costfields from GPU runs of each template once this branch is deployed to lem.tests/test_catalog_structure.py::test_the_compact_listing_fits_the_budgetfails at 11256 vs a budget of 10850. The overage is in the new templates'summarylines; trimming saves only about 40 tokens. A budget raise is the owner's call, best sized after Task 9 adds cost blocks.dw/tasks/speech_generation.py:219(generate_kwargs/forward_params) has the samecustom_generateremote-code exposure.dw/tasks/image_utils.py:103/114/124pass workflow kwargs to detectors unaudited.Tests
The full suite passes (14927), except the budget test above. Per-task reviews plus a final whole-branch review were run. Three background security findings were fixed during the work: an SSRF through a kwargs splat, disclosure through the server token, and a fail-open cache.
🤖 Generated with Claude Code