support the inference of FLUX Fill, FLUX Redux, Insert Anything - #1577
Open
huan-yin wants to merge 3 commits into
Open
support the inference of FLUX Fill, FLUX Redux, Insert Anything#1577huan-yin wants to merge 3 commits into
huan-yin wants to merge 3 commits into
Conversation
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.
Add Inference Support for Flux Fill, Flux Redux, and Insert Anything
Commit Introduction
Inference capabilities for three FLUX-series models:
All three capabilities are exposed through the unified
FluxImagePipelineinterface.1. FLUX.1-Fill-dev: Masked Image Inpainting
Overview
FLUX.1-Fill-dev is a dedicated inpainting model. Given an image and a binary mask, it fills the masked region according to a text prompt while preserving the unmasked parts of the original image. It is suitable for object removal, content completion, and outpainting tasks.
Example Script
examples/flux/model_inference_low_vram/FLUX.1-Fill-dev.py
Inputs and Output
cup.png: Source image of a paper cup placed on sand.cup_mask.png: Mask marking the region to regenerate.a white paper cupThe model regenerates a white paper cup with a sun-like pattern inside the masked area, keeping the surrounding sand and lighting consistent.
2. FLUX.1-Redux-dev: Image Semantic Transfer
Overview
FLUX.1-Redux-dev is designed for image semantic transfer (image variation / style and structure transfer). Given a reference image, the model extracts high-level semantic information and generates a new image that preserves the subject, composition, or style—without requiring a text prompt.
Example Script
examples/flux/model_inference_low_vram/FLUX.1-Redux-dev.py
Inputs and Output
robot.png: Reference image of a red cartoon robot standing next to a podium.The generated result preserves the red robot, podium, and antenna as core semantic elements, while producing a reasonable re-interpretation of pose and detail.
3. Insert-Anything: Arbitrary Object Insertion
Overview
Insert-Anything is a community LoRA built on FLUX for "insert any object into any scene". It takes four inputs:
The model blends the reference object into the masked region of the source image while matching lighting, perspective, and style.
Example Script
examples/flux/model_inference_low_vram/Insert-Anything.py
Inputs and Output
source_image.png: Source image (e.g., a person photo).source_mask.png: Mask of the region to replace in the source image (e.g., the jersey area).ref_image.png: Reference image (e.g., another jersey).ref_mask.png: Mask of the object to insert from the reference image.The output naturally fuses the reference object onto the person in the source image, preserving pose, skin tone, and background while performing the garment replacement insertion.