feat(image-gen): FLUX Redux multi-image blend + Pictures/mflux subdir#13
Merged
Conversation
Two bundled changes that were tested live tonight and held until the docs were ready. 1. Multi-image FLUX Redux on FLUX.1-dev scripts/flux.py: --image-path becomes action="append". 0 paths = txt2img (unchanged); 1 path = img2img on schnell (unchanged); 2+ paths = switch to Flux1Redux on FLUX.1-dev via mflux.models.flux.variants.redux. New --dev-model-path constant (~/mflux-models/dev-4bit) plus optional multi-valued --image-strength for Redux per-image weights. Defaults to strength 0.4 when single --image-path is set (workaround for MFLUX silently dropping img2img if strength is unset); Redux defaults to 1.0 per image via mflux's ReduxUtil.validate_redux_image_strengths. scripts/flux-ssh.py: --reference becomes action="append" with stage_ reference_on_mini handling URL (curl on mini) or local path (scp Linux→ mini) per reference, indexed temp names so cleanup is clean. Strength flag mirrors the mini-side semantics. Verified end-to-end: corgi-in-astronaut-helmet (ref 1) + Japanese tea garden (ref 2) + prompt "a corgi sitting by a koi pond in a Japanese tea garden, golden hour, photorealistic" produced the expected blended output at ~146 s on the M2 Pro mini. SigLIP encoder + Redux adapter auto-downloaded on first invocation (~3 GB). FLUX.1-dev base weights saved separately via mflux-save (~9 GB at 4-bit, ~31 GB transient FP16 deleted after). Non-commercial license on FLUX.1-dev is called out in the README. Schnell paths (txt2img + single-ref img2img) remain Apache 2.0. 2. ~/Pictures/mflux subdirectory Both wrappers now default to ~/Pictures/mflux/ instead of dropping files at the top of ~/Pictures. CryptoJones asked for the reorg so generated PNGs don't crowd actual photos. mkdir handled by the LOCAL_OUTPUT_DIR.mkdir / args.output.parent.mkdir on each side. Existing renders on both machines moved into the new path manually before deploy. README updates: - Files table entries for both scripts reflect the new default path and the multi-image support. - New "Multi-image blend (FLUX Redux on FLUX.1-dev)" subsection covers the install (mflux-save dev), the speed/license/disk tradeoffs vs. schnell, the per-image-strength semantics, and one verified example. - Hardware-assumptions disk numbers add the +9 GB dev-4bit footprint. - The "weak at style transfer" paragraph in the img2img section is walked back: it previously said FLUX.1-dev wasn't set up; the dev install now exists for the Redux path even though single-ref img2img hasn't been migrated to it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Closes #12.
Summary
--image-path(mini) /--reference(client) become repeatable; 2+ values triggers Flux1Redux on FLUX.1-dev. New--dev-model-pathconstant defaulting to~/mflux-models/dev-4bit. Per-image strength via repeated--image-strength(defaults to 1.0 each via mflux's ReduxUtil).~/Pictures/to~/Pictures/mflux/on both sides. mkdir handled by existing parent.mkdir calls.Test plan
mflux-save --model dev --quantize 4 --path ~/mflux-models/dev-4bitproduced a 9 GB self-contained dev install; 31 GB FP16 cache deleted after, freeing ~22 GB net~/Pictures/mflux/on both the mini and the Linux client; mini-side cleanup left no orphans in/tmp/--referenceimg2img path still works (regression check via Linux client)python3 -m py_compileclean on both scriptsCodeberg note
Mirrored to Codeberg via SSH push only (no API token, per the new standing rule on this repo). Codeberg PR record will not exist; mirror convergence happens via the force-push reconciliation step after this merges.
Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/