Spaces:
Running
Running
Download index.html from wavespeed/qwen-edit-image: direct link, hf CLI and curl.
- Browser
- Download file 12.3 kB
-
https://huggingface.co/spaces/wavespeed/qwen-edit-image/resolve/main/index.html
- Command line
-
hf download hf://spaces/wavespeed/qwen-edit-image/index.html
-
curl -L -o index.html https://huggingface.co/spaces/wavespeed/qwen-edit-image/resolve/main/index.html
12.3 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | |
| <title>Qwen-Image-Edit — instruction-based image editing</title> | |
| <meta name="description" content="Reference for Qwen-Image-Edit, Alibaba's open instruction-driven image editing model, with hosted API usage and local diffusers setup." /> | |
| <link rel="canonical" href="https://wavespeed.ai/models/wavespeed-ai/qwen-image/edit?utm_source=huggingface&utm_medium=space&utm_campaign=qwen_edit_image" /> | |
| <meta property="og:type" content="website" /> | |
| <meta property="og:title" content="Qwen-Image-Edit — instruction-based image editing" /> | |
| <meta property="og:description" content="Reference for Qwen-Image-Edit, Alibaba's open instruction-driven image editing model, with hosted API usage and local diffusers setup." /> | |
| <meta property="og:url" content="https://wavespeed.ai/models/wavespeed-ai/qwen-image/edit" /> | |
| <meta property="og:image" content="https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-Image/merge3.jpg" /> | |
| <meta name="twitter:card" content="summary_large_image" /> | |
| <link rel="stylesheet" href="style.css" /> | |
| </head> | |
| <body> | |
| <header class="site-header"> | |
| <div class="wrap"> | |
| <a class="brand" href="https://wavespeed.ai?utm_source=huggingface&utm_medium=space&utm_campaign=qwen_edit_image" target="_blank" rel="noopener"> | |
| <span class="brand-mark" aria-hidden="true"></span> | |
| <span>WaveSpeed AI</span> | |
| </a> | |
| <nav class="header-nav"> | |
| <a class="jump opt" href="#overview">Overview</a> | |
| <a class="jump opt" href="#edits">Edit types</a> | |
| <a class="jump" href="#run">Run it</a> | |
| <a class="jump opt" href="#local">Local</a> | |
| <a class="jump" href="#resources">Resources</a> | |
| <a href="https://wavespeed.ai/models/wavespeed-ai/qwen-image/edit?utm_source=huggingface&utm_medium=space&utm_campaign=qwen_edit_image" target="_blank" rel="noopener">wavespeed.ai ↗</a> | |
| </nav> | |
| </div> | |
| </header> | |
| <main class="wrap"> | |
| <div class="hero"> | |
| <p class="eyebrow">Alibaba Cloud · Qwen Team</p> | |
| <h1>Qwen-Image-Edit</h1> | |
| <p class="lede">The editing counterpart to Qwen-Image. It takes an existing image plus a written instruction and applies the change while leaving the rest of the frame — including identity and layout — intact.</p> | |
| <ul class="meta"> | |
| <li><b>Developer</b> Alibaba Cloud Qwen Team</li> | |
| <li><b>Task</b> instruction-based image editing</li> | |
| <li><b>License</b> Apache-2.0</li> | |
| <li><b>Weights</b> open</li> | |
| </ul> | |
| </div> | |
| <section id="overview"> | |
| <h2>Overview</h2> | |
| <p class="section-note">Editing is expressed as an instruction rather than a mask. The model inherits Qwen-Image's text rendering, which is what makes editing text already present in a photograph practical.</p> | |
| <div class="figure-single"> | |
| <figure> | |
| <img src="https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-Image/merge3.jpg" alt="Qwen-Image sample outputs" loading="lazy" /> | |
| <figcaption>Sample outputs from the Qwen-Image release.</figcaption> | |
| </figure> | |
| </div> | |
| </section> | |
| <section id="edits"> | |
| <h2>Edit types</h2> | |
| <div class="grid"> | |
| <div class="card"> | |
| <h3>Semantic edits</h3> | |
| <p>Change what is in the scene — add, remove or replace an object — while lighting and perspective stay consistent with the original.</p> | |
| </div> | |
| <div class="card"> | |
| <h3>Appearance edits</h3> | |
| <p>Restyle or recolour without moving anything, so composition and structure survive the edit unchanged.</p> | |
| </div> | |
| <div class="card"> | |
| <h3>Text editing</h3> | |
| <p>Replace words rendered inside the image while matching the existing font, perspective and surface — the capability inherited from Qwen-Image.</p> | |
| </div> | |
| <div class="card"> | |
| <h3>Identity preservation</h3> | |
| <p>Faces and distinctive objects are held stable across the edit, which is what makes chained edits usable.</p> | |
| </div> | |
| </div> | |
| </section> | |
| <section id="variants"> | |
| <h2>Hosted variants</h2> | |
| <div class="table-scroll"> | |
| <table> | |
| <thead><tr><th>Endpoint</th><th>Notes</th></tr></thead> | |
| <tbody> | |
| <tr><td><code>wavespeed-ai/qwen-image/edit</code></td><td>Base instruction-driven editing.</td></tr> | |
| <tr><td><code>wavespeed-ai/qwen-image/edit-plus</code></td><td>Updated editing checkpoint.</td></tr> | |
| <tr><td><code>wavespeed-ai/qwen-image/edit-plus-lora</code></td><td>Editing with LoRA adapters applied.</td></tr> | |
| </tbody> | |
| </table> | |
| </div> | |
| </section> | |
| <section id="run"> | |
| <h2>Run it</h2> | |
| <p class="section-note">Pass a publicly reachable image URL, or upload first via <code>POST /media/upload/binary</code> and use the returned URL.</p> | |
| <div class="code"> | |
| <div class="code-tabs" role="tablist"> | |
| <button type="button" role="tab" aria-selected="true" data-panel="run-0">cURL</button> | |
| <button type="button" role="tab" aria-selected="false" data-panel="run-1">Python</button> | |
| <button type="button" role="tab" aria-selected="false" data-panel="run-2">JavaScript</button> | |
| </div> | |
| <pre id="run-0" role="tabpanel"><code># 1. submit the job | |
| curl -X POST "https://api.wavespeed.ai/api/v3/wavespeed-ai/qwen-image/edit" \ | |
| -H "Authorization: Bearer $WAVESPEED_API_KEY" \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "image": "https://example.com/input.jpg", | |
| "prompt": "Replace the text on the sign with \"Open until 9pm\", keep the original font and perspective", | |
| "enable_sync_mode": false | |
| }' | |
| # -> {"code": 200, "data": {"id": "<request-id>", "status": "created", ...}} | |
| # 2. poll until status is "completed" | |
| curl "https://api.wavespeed.ai/api/v3/predictions/<request-id>/result" \ | |
| -H "Authorization: Bearer $WAVESPEED_API_KEY" | |
| # -> {"code": 200, "data": {"status": "completed", "outputs": ["https://..."]}}</code></pre> | |
| <pre id="run-1" role="tabpanel" hidden><code>import os, time, requests | |
| API = "https://api.wavespeed.ai/api/v3" | |
| KEY = os.environ["WAVESPEED_API_KEY"] | |
| HEADERS = {"Authorization": f"Bearer {KEY}"} | |
| # submit | |
| res = requests.post( | |
| f"{API}/wavespeed-ai/qwen-image/edit", | |
| headers={**HEADERS, "Content-Type": "application/json"}, | |
| json={ | |
| "image": "https://example.com/input.jpg", | |
| "prompt": "Replace the text on the sign with \"Open until 9pm\", keep the original font and perspective", | |
| "enable_sync_mode": false | |
| }, | |
| timeout=30, | |
| ) | |
| res.raise_for_status() | |
| request_id = res.json()["data"]["id"] | |
| # poll | |
| while True: | |
| data = requests.get( | |
| f"{API}/predictions/{request_id}/result", | |
| headers=HEADERS, | |
| timeout=30, | |
| ).json()["data"] | |
| if data["status"] == "completed": | |
| print(data["outputs"][0]) | |
| break | |
| if data["status"] == "failed": | |
| raise RuntimeError(data.get("error", "generation failed")) | |
| time.sleep(1.5)</code></pre> | |
| <pre id="run-2" role="tabpanel" hidden><code>const API = "https://api.wavespeed.ai/api/v3"; | |
| const KEY = process.env.WAVESPEED_API_KEY; | |
| const headers = { Authorization: `Bearer ${KEY}` }; | |
| // submit | |
| const submit = await fetch(`${API}/wavespeed-ai/qwen-image/edit`, { | |
| method: "POST", | |
| headers: { ...headers, "Content-Type": "application/json" }, | |
| body: JSON.stringify({ | |
| "image": "https://example.com/input.jpg", | |
| "prompt": "Replace the text on the sign with \"Open until 9pm\", keep the original font and perspective", | |
| "enable_sync_mode": false | |
| }), | |
| }); | |
| const { data: { id } } = await submit.json(); | |
| // poll | |
| for (;;) { | |
| const res = await fetch(`${API}/predictions/${id}/result`, { headers }); | |
| const { data } = await res.json(); | |
| if (data.status === "completed") { | |
| console.log(data.outputs[0]); | |
| break; | |
| } | |
| if (data.status === "failed") throw new Error(data.error ?? "generation failed"); | |
| await new Promise((r) => setTimeout(r, 1500)); | |
| }</code></pre> | |
| </div> | |
| <div class="callout"><p>Requests are asynchronous: <code>POST</code> returns a request id, then you poll <code>/predictions/<id>/result</code> until <code>status</code> is <code>completed</code>. Set <code>enable_sync_mode: true</code> to have the call block and return outputs directly.</p><p>API keys are created in the <a href="https://wavespeed.ai/dashboard?utm_source=huggingface&utm_medium=space&utm_campaign=qwen_edit_image" target="_blank" rel="noopener">WaveSpeed dashboard</a>.</p></div> | |
| <div class="btn-row"> | |
| <a class="btn" href="https://wavespeed.ai/models/wavespeed-ai/qwen-image/edit?utm_source=huggingface&utm_medium=space&utm_campaign=qwen_edit_image" target="_blank" rel="noopener">Open on WaveSpeed</a> | |
| <a class="btn secondary" href="https://wavespeed.ai/docs?utm_source=huggingface&utm_medium=space&utm_campaign=qwen_edit_image" target="_blank" rel="noopener">API reference</a> | |
| </div> | |
| </section> | |
| <section id="local"> | |
| <h2>Running locally</h2> | |
| <p class="section-note">Weights are Apache-2.0 and load through <code>diffusers</code>.</p> | |
| <div class="code"> | |
| <div class="code-tabs" role="tablist"> | |
| <button type="button" role="tab" aria-selected="true" data-panel="local-0">Python</button> | |
| </div> | |
| <pre id="local-0" role="tabpanel"><code>import torch | |
| from PIL import Image | |
| from diffusers import QwenImageEditPipeline | |
| pipe = QwenImageEditPipeline.from_pretrained( | |
| "Qwen/Qwen-Image-Edit", | |
| torch_dtype=torch.bfloat16, | |
| ).to("cuda") | |
| image = Image.open("input.jpg").convert("RGB") | |
| out = pipe( | |
| image=image, | |
| prompt='Replace the text on the sign with "Open until 9pm", ' | |
| "keep the original font and perspective", | |
| negative_prompt=" ", | |
| num_inference_steps=50, | |
| true_cfg_scale=4.0, | |
| generator=torch.Generator(device="cuda").manual_seed(42), | |
| ).images[0] | |
| out.save("edited.png")</code></pre> | |
| </div> | |
| </section> | |
| <section id="resources"> | |
| <h2>Resources</h2> | |
| <ul class="links"> | |
| <li><a href="https://huggingface.co/Qwen/Qwen-Image-Edit" target="_blank" rel="noopener"><span>Qwen/Qwen-Image-Edit weights</span><span class="host">huggingface.co</span></a></li> | |
| <li><a href="https://github.com/QwenLM/Qwen-Image" target="_blank" rel="noopener"><span>Qwen-Image on GitHub</span><span class="host">github.com</span></a></li> | |
| <li><a href="https://wavespeed.ai/models/wavespeed-ai/qwen-image/edit?utm_source=huggingface&utm_medium=space&utm_campaign=qwen_edit_image" target="_blank" rel="noopener"><span>Hosted endpoint</span><span class="host">wavespeed.ai</span></a></li> | |
| <li><a href="https://huggingface.co/spaces/wavespeed/qwen-image" target="_blank" rel="noopener"><span>Text-to-image variant</span><span class="host">huggingface.co</span></a></li> | |
| </ul> | |
| </section> | |
| </main> | |
| <footer class="site-footer"> | |
| <div class="wrap"> | |
| <p>This page is a model reference maintained by WaveSpeed AI. The model itself is developed and released by its respective authors; trademarks belong to them. WaveSpeed AI provides hosted inference for it.</p> | |
| <div class="footer-links"> | |
| <a href="https://wavespeed.ai?utm_source=huggingface&utm_medium=space&utm_campaign=qwen_edit_image" target="_blank" rel="noopener">WaveSpeed AI</a> | |
| <a href="https://wavespeed.ai/docs?utm_source=huggingface&utm_medium=space&utm_campaign=qwen_edit_image" target="_blank" rel="noopener">Docs</a> | |
| <a href="https://huggingface.co/wavespeed" target="_blank" rel="noopener">Hugging Face</a> | |
| </div> | |
| </div> | |
| </footer> | |
| <script src="tabs.js"></script> | |
| </body> | |
| </html> | |