Instructions to use remyxai/flowedit-flux-modular with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use remyxai/flowedit-flux-modular with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("remyxai/flowedit-flux-modular", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
FlowEdit for FLUX β training-free, inversion-free image editing (Modular Diffusers custom block)
Text-based image editing on off-the-shelf FLUX.1-dev β no inversion, no fine-tuning β as a Modular Diffusers custom block. Implements FlowEdit (arXiv:2412.08629): instead of inverting the source image, it builds an ODE that transports it directly from the source prompt to the target prompt β more faithful to the original (structure preserved) and faster than inversion-based editing.
β edit your own photo by changing the prompt.
One source image, two edits (matched source prompt β target prompt) β the subject changes, the pose / composition / background are preserved. Training-free, no inversion.
Usage
import torch
from diffusers import ModularPipeline
pipe = ModularPipeline.from_pretrained("remyxai/flowedit-flux-modular", trust_remote_code=True)
pipe.load_components(dtype=torch.bfloat16)
pipe.to("cuda")
edited = pipe(
image="cat.png",
source_prompt="a cat", # describes the source image
prompt="a dog", # the target edit
T_steps=28, src_guidance_scale=1.5, tar_guidance_scale=5.5, n_max=24, n_min=0,
).images[0]
edited.save("edited.png")
Tip: the source_prompt should describe what's actually in the image; the prompt is the edit. A good
source_prompt is what makes the edit faithful. No extra weights or models β it's fully training-free.
How it works
FlowEdit is inversion-free. At each step it draws noise to form a source point zt_src and a coupled
target point zt_tar, computes the model's velocity for each under the source and target prompts, and
integrates the guided velocity difference Vt_tar β Vt_src into a running edit latent β over a step window
(n_max β¦ n_min), averaged over n_avg noise draws. Because it never inverts the image, the edit stays
anchored to the original structure. A self-contained custom denoise loop; the base weights are untouched.
Key parameters
| arg | default | meaning |
|---|---|---|
image |
β | source image (path / PIL / numpy RGB) |
source_prompt |
β | description of the source image |
prompt |
β | the target edit |
tar_guidance_scale |
5.5 | edit strength (β = stronger edit) |
src_guidance_scale |
1.5 | source guidance |
T_steps |
28 | total steps |
n_max / n_min |
24 / 0 | step window where the edit ODE is applied (raise n_min for an SDEdit-style tail) |
n_avg |
1 | velocity-difference averaging (β = smoother, slower) |
Attribution & AI assistance
Training-free reimplementation for Modular Diffusers of FlowEdit (MIT, fallenshock/FlowEdit). The Modular-Diffusers adaptation was authored with AI assistance (Claude) and validated by the Remyx AI team; method credit to the FlowEdit authors. Uses FLUX.1-dev under its non-commercial license.
Citation
@misc{kulikov2024flowedit,
title={FlowEdit: Inversion-Free Text-Based Editing Using Pre-Trained Flow Models},
author={Kulikov, Vladimir and Kleiner, Matan and Huberman-Spiegelglas, Inbar and Michaeli, Tomer},
year={2024},
eprint={2412.08629}, archivePrefix={arXiv}, primaryClass={cs.CV},
url={https://arxiv.org/abs/2412.08629}
}
- Downloads last month
- 8
