Qwen Image Edit 2509 Plus – LoRA Lab
Bring any LoRA you like to Qwen’s latest image editing pipeline. This Replicate model keeps Lightning speed by default, lets you hot-swap LoRAs straight from Hugging Face or direct URLs, and still handles multi-image edits, ControlNet-style prompts, and bilingual instructions.
What it does
- Accepts one or more reference images plus a mandatory text prompt. Edits respect composition, identity, and typography across portraits, products, and scenes.
- Runs the Qwen Image Edit 2509 (Plus) pipeline with the Lightning adapter active for 8-step, bfloat16 inference.
- Optionally fuses in a custom LoRA (lora_weights) on top of Lightning, with adjustable strength (lora_scale) and automatic caching/format fixes.
- Provides a 40-step fallback path (go_fast=false) for higher-fidelity passes without Lightning.
- Screens outputs with both Stable Diffusion and Falcon NSFW safety checkers unless you explicitly disable them.
———
How LoRA loading works
- lora_weights accepts:
- A Hugging Face repo slug like owner/model (expects pytorch_lora_weights.safetensors in the repo’s root).
- A direct HTTPS link to a .safetensors file.
- Automatic caching: First-time downloads are cached under /tmp/lora_cache so repeated runs reuse the file.
- Key remapping: If raw loading fails, the pipeline transparently rewrites keys (drops .default. segments, prefixes transformer.) and caches the transformed copy for next time.
- Stacking behavior:
- go_fast=true (default) blends Lightning + your LoRA.
- go_fast=false removes Lightning; if a LoRA was loaded it runs alone; otherwise you get pure base model.
- lora_scale (0.0–4.0): Scales only the custom adapter. Set 0 to effectively disable the LoRA while keeping it available for later runs.
- Unsupported: zipped/tar archives or non-safetensor formats.
Model inputs
- image (required) – One or more JPEG/PNG/GIF/WebP images; multi-image prompts let you swap outfits, poses, products, etc.
- prompt (required) – Editing directive appended to Qwen’s internal bilingual instruction. Mention what to change and what to preserve.
- aspect_ratio (optional) – match_input_image, 1:1, 16:9, 9:16, 4:3, or 3:4. Non-matching ratios snap to 32-pixel-aligned sizes.
- go_fast (optional, default true) – Lightning path (8 steps). Set false for 40 steps, CFG 4.0, and no Lightning adapter.
- lora_weights (optional) – See section above; blank means Lightning only.
- lora_scale (optional, default 1.0) – Strength for the custom LoRA.
- seed (optional) – Integer for reproducible edits.
- output_format (optional, default webp) – Choose webp, jpg, or png.
- output_quality (optional, default 95) – Applies to webp/jpg.
- disable_safety_checker (optional, default false) – Skip both NSFW screens if you must.
Outputs
Returns an array of image URLs (one per generated frame). If both safety checkers disagree with your prompt, the run fails with an NSFW warning.
Example workflows
-
Blend a custom style LoRA with Lightning
image=@portrait.png prompt="Convert to watercolor illustration" lora_weights="flymy-ai/qwen-image-lora" lora_scale=0.9 go_fast=true -
Try a raw safetensors LoRA from a URL
image=@product.jpg prompt="Studio packshot, dramatic rim light" lora_weights="https://huggingface.co/owner/model/resolve/main/packshot.safetensors" -
High-quality base edit (no adapters)
image=@scene.webp prompt="Change the time of day to sunset" go_fast=false lora_weights=""
Tips
- Let the prompt spell out both the change and what to keep (“replace the jacket with a leather biker jacket; keep the pose and background”).
- For subtle stylization, start around lora_scale=0.6–1.0; push toward 1.5+ for dramatic transformations.
- If your Hugging Face LoRA fails once, re-run—the transformed copy is cached and usually loads instantly afterward.
- Multi-image edits work best with 1–3 references. Describe which image contributes which element (“Image 1 face, Image 2 outfit”).
- Keep go_fast=true for quick previews; flip it off when you need slower, higher-contrast outputs or when mixing conflicting LoRAs.
- Leaving disable_safety_checker at false gives you two guardrails: Stable Diffusion’s classifier and Falcon’s NSFW detector.
Under the hood
- Base pipeline: Qwen/Qwen-Image-Edit-2509 (Plus variant).
- Lightning adapter: lightx2v/Qwen-Image-Lightning preloaded at weight 1.0.
- Optimizations: Pruna runtime for memory/perf, bfloat16 inference, per-run cache tuning.
- Safety: Stable Diffusion Safety Checker (CUDA, float16) + Falconsai NSFW classifier.
Ready to experiment? Drop in an image, paste your LoRA slug, and dial in the mix to build your own library of Qwen edits.