QWEN_EDIT_IMAGE / README.md
kulkas2pintu's picture
Upload README.md with huggingface_hub
80a4517 verified
|
Raw
History Blame Contribute Delete
4.9 kB

A newer version of the Gradio SDK is available: 6.26.0

Upgrade
metadata
title: Qwen-Image-Edit-2511-LoRAs-Fast
emoji: 🎃
colorFrom: blue
colorTo: blue
sdk: gradio
sdk_version: 6.20.0
app_file: app.py
pinned: true
license: apache-2.0
short_description: Demo of the Collection of Qwen Image Edit LoRAs

Prompt-based image editing on Qwen-Image-Edit-2511, with identity preservation (change pose/clothes/scene while keeping the person's face), HD output, and an anti-deformed-hands option.

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference


API

The Space exposes one endpoint: /edit. Base URL / Space id: kulkas2pintu/QWEN_EDIT_IMAGE.

Parameters

name type default meaning
image image (filepath/URL) required. The image to edit (the person/subject whose identity is kept).
prompt str required. What to change, e.g. "change her outfit to a red dress; turn to look left".
lora_adapter str "" Optional style LoRA name (see list below). "" = no style / base edit.
image2 image None Optional 2nd reference image (e.g. a style or lighting reference).
seed int 0 Seed; ignored when randomize_seed=True.
randomize_seed bool True Pick a new random seed each call.
guidance_scale float 1.0 true-CFG. 1.0 = fastest. >1 (e.g. 2.5) activates the negative prompt that suppresses extra fingers / identity drift (slower, ~2×).
steps int 4 Denoise steps. 4 is native for this distilled model.
preserve_identity bool True Keep the person's face while pose/head can change.
identity_strength int 65 0-100, how forcefully identity is locked.
output_size int 1280 Long-side pixels 1024-2048. Higher = more HD detail, slower (~quadratic).
fix_hands bool False Raise CFG/steps to suppress extra/fused fingers (slower).

Returns: [result_image, seed_used].

Available lora_adapter names

Multiple-Angles, Fal-Multiple-Angles (best for pose/angle changes), Photo-to-Anime, Anime-V2, Light-Migration, Any-light, Studio-DeLight, Cinematic-FlatLog, Upscaler, Unblur-Anything, Style-Transfer, Manga-Tone, Anything2Real, Polaroid-Photo, Midnight-Noir-Eyes-Spotlight, Hyper-Realistic-Portrait, Ultra-Realistic-Portrait, Pixar-Inspired-3D, Noir-Comic-Book.

Tip: for realistic edits keep preserve_identity=True. Uncheck it (preserve_identity=False) for full-transform styles like Photo-to-Anime / Pixar-Inspired-3D.

Python (gradio_client)

pip install gradio_client
from gradio_client import Client, handle_file

client = Client("kulkas2pintu/QWEN_EDIT_IMAGE")  # add hf_token="hf_..." for a private Space

result_image, seed_used = client.predict(
    image=handle_file("https://example.com/person.jpg"),  # or a local path
    prompt="change her outfit to an elegant red dress; turn her head to the left",
    lora_adapter="",            # or e.g. "Fal-Multiple-Angles" for pose changes
    image2=None,
    seed=0,
    randomize_seed=True,
    guidance_scale=2.5,          # >1 turns on hand/identity negatives
    steps=6,
    preserve_identity=True,
    identity_strength=80,
    output_size=1536,            # HD
    fix_hands=True,
    api_name="/edit",
)
print("saved to:", result_image, "| seed:", seed_used)

result_image is a local filepath to the PNG result.

JavaScript (@gradio/client)

npm i @gradio/client
import { Client } from "@gradio/client";

const image = await (await fetch("https://example.com/person.jpg")).blob();
const client = await Client.connect("kulkas2pintu/QWEN_EDIT_IMAGE");

const res = await client.predict("/edit", {
  image,
  prompt: "change her outfit to a red dress",
  lora_adapter: "",
  guidance_scale: 2.5,
  steps: 6,
  output_size: 1536,
  fix_hands: true,
});
console.log(res.data);   // [result_image, seed_used]

curl (raw REST)

Gradio's REST API is a two-step call (queue → result):

# 1) submit the job (image can be a public URL)
curl -s -X POST https://kulkas2pintu-qwen-edit-image.hf.space/gradio_api/call/edit \
  -H "Content-Type: application/json" \
  -d '{"data":[
        {"path":"https://example.com/person.jpg"},
        "change her outfit to a red dress",
        "", null, 0, true, 2.5, 6, true, 80, 1536, true
      ]}'
# -> {"event_id":"<id>"}

# 2) stream the result
curl -N https://kulkas2pintu-qwen-edit-image.hf.space/gradio_api/call/edit/<id>

The data array is positional, in the same order as the parameter table above.

The live, always-up-to-date schema is at https://kulkas2pintu-qwen-edit-image.hf.space/gradio_api/ (the "view API" JSON). This Space also runs as an MCP server (/gradio_api/mcp/), so /edit is usable as a tool from MCP-compatible clients.