A web interface (in the style of the official Qwen/Qwen-Image-Edit-2511 Space) for Phr00t/Qwen-Image-Edit-Rapid-AIO — a Lightning-merged FP8 build of Qwen-Image-Edit-2511 that edits images in ~4 inference steps with CFG 1.0. Default checkpoint: v23 NSFW.
Only the transformer is taken from the AIO checkpoint (loaded with
QwenImageTransformer2DModel.from_single_file, FP8 storage with bf16 compute
via layerwise casting); the text encoder / VAE / processor come from the base
Qwen/Qwen-Image-Edit-2511 repo. No ComfyUI needed. GGUF checkpoints (e.g.
Phil2Sat/Qwen-Image-Edit-Rapid-AIO-GGUF)
are also supported via MODEL_URL.
https://<workspace>--qwen-image-edit-rapid-web.modal.run.SPACE_MODE=remote).scripts/deploy_via_hf.py for environments where
the Modal CLI cannot connect (it sets up a private "deployer" Space that
runs modal deploy from Hugging Face infrastructure).ak-…) and secret
(as-…).Settings → Secrets and variables → Actions → New repository secret:
| Secret | Value |
|---|---|
MODAL_TOKEN_ID | ak-… |
MODAL_TOKEN_SECRET | as-… |
HF_TOKEN | your write token |
MODAL_AUTH_TOKEN | (optional) any password — protects the backend API & Modal UI |
When MODAL_AUTH_TOKEN is set, the API requires an
Authorization: Bearer <token> header, and the Modal-hosted web UI asks for a
login: username user, password = the token. The Space authenticates
automatically via its MODAL_AUTH_TOKEN secret.
Actions tab → Deploy → Run workflow (it also runs automatically on every
push to main). The job summary shows both URLs when done:
https://<workspace>--qwen-image-edit-rapid-web.modal.runhttps://huggingface.co/spaces/<you>/qwen-image-edit-rapidThe first deploy includes a warm-up run that downloads ~35 GB of weights into a Modal volume (can take 15–30 min). After that, cold starts are much faster and the container scales to zero after 5 idle minutes, so you only pay while generating.
Settings → Secrets and variables → Actions → Variables:
| Variable | Default | Purpose |
|---|---|---|
HF_SPACE_ID | <you>/qwen-image-edit-rapid | Space name |
SPACE_MODE | local | local = ZeroGPU inference on the Space; remote = thin client for Modal |
MODAL_GPU | L40S | e.g. A100-80GB, L4 (with LOW_VRAM=1) |
MODEL_URL | Phr00t AIO v23 NSFW | HF blob URL of another checkpoint (.safetensors AIO or .gguf) |
BASE_REPO | Qwen/Qwen-Image-Edit-2511 | base pipeline repo |
LOW_VRAM | (unset) | set to 1 to enable CPU offload on smaller GPUs (Modal) |
MODAL_ENDPOINT_URL | (unset) | backend URL for SPACE_MODE=remote |
curl -X POST "https://<workspace>--qwen-image-edit-rapid-web.modal.run/v1/edit" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MODAL_AUTH_TOKEN" \
-d '{
"prompt": "make the sky a dramatic sunset",
"images": ["<base64-encoded png or jpeg>"],
"num_inference_steps": 4,
"true_cfg_scale": 1.0
}'
Response: {"images": ["<base64 png>", …], "seed": 123}. Up to 3 input images
and 4 outputs per request. Omit seed for a random one.
LOW_VRAM=1)pip install -r requirements.txt
python app.py # local inference
# or use a remote backend:
MODAL_ENDPOINT_URL=https://…modal.run python app.py
v23/Qwen-Rapid-AIO-NSFW-v23.safetensors (28.4 GB, FP8).
Phr00t's notes: v19 is best for edit consistency, v23 for prompt adherence;
each version has SFW and NSFW variants. Switch with the MODEL_URL variable.Python
100.0%
A web interface (in the style of the official Qwen/Qwen-Image-Edit-2511 Space) for Phr00t/Qwen-Image-Edit-Rapid-AIO — a Lightning-merged FP8 build of Qwen-Image-Edit-2511 that edits images in ~4 inference steps with CFG 1.0. Default checkpoint: v23 NSFW.
Only the transformer is taken from the AIO checkpoint (loaded with
QwenImageTransformer2DModel.from_single_file, FP8 storage with bf16 compute
via layerwise casting); the text encoder / VAE / processor come from the base
Qwen/Qwen-Image-Edit-2511 repo. No ComfyUI needed. GGUF checkpoints (e.g.
Phil2Sat/Qwen-Image-Edit-Rapid-AIO-GGUF)
are also supported via MODEL_URL.
https://<workspace>--qwen-image-edit-rapid-web.modal.run.SPACE_MODE=remote).scripts/deploy_via_hf.py for environments where
the Modal CLI cannot connect (it sets up a private "deployer" Space that
runs modal deploy from Hugging Face infrastructure).ak-…) and secret
(as-…).Settings → Secrets and variables → Actions → New repository secret:
| Secret | Value |
|---|---|
MODAL_TOKEN_ID | ak-… |
MODAL_TOKEN_SECRET | as-… |
HF_TOKEN | your write token |
MODAL_AUTH_TOKEN | (optional) any password — protects the backend API & Modal UI |
When MODAL_AUTH_TOKEN is set, the API requires an
Authorization: Bearer <token> header, and the Modal-hosted web UI asks for a
login: username user, password = the token. The Space authenticates
automatically via its MODAL_AUTH_TOKEN secret.
Actions tab → Deploy → Run workflow (it also runs automatically on every
push to main). The job summary shows both URLs when done:
https://<workspace>--qwen-image-edit-rapid-web.modal.runhttps://huggingface.co/spaces/<you>/qwen-image-edit-rapidThe first deploy includes a warm-up run that downloads ~35 GB of weights into a Modal volume (can take 15–30 min). After that, cold starts are much faster and the container scales to zero after 5 idle minutes, so you only pay while generating.
Settings → Secrets and variables → Actions → Variables:
| Variable | Default | Purpose |
|---|---|---|
HF_SPACE_ID | <you>/qwen-image-edit-rapid | Space name |
SPACE_MODE | local | local = ZeroGPU inference on the Space; remote = thin client for Modal |
MODAL_GPU | L40S | e.g. A100-80GB, L4 (with LOW_VRAM=1) |
MODEL_URL | Phr00t AIO v23 NSFW | HF blob URL of another checkpoint (.safetensors AIO or .gguf) |
BASE_REPO | Qwen/Qwen-Image-Edit-2511 | base pipeline repo |
LOW_VRAM | (unset) | set to 1 to enable CPU offload on smaller GPUs (Modal) |
MODAL_ENDPOINT_URL | (unset) | backend URL for SPACE_MODE=remote |
curl -X POST "https://<workspace>--qwen-image-edit-rapid-web.modal.run/v1/edit" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MODAL_AUTH_TOKEN" \
-d '{
"prompt": "make the sky a dramatic sunset",
"images": ["<base64-encoded png or jpeg>"],
"num_inference_steps": 4,
"true_cfg_scale": 1.0
}'
Response: {"images": ["<base64 png>", …], "seed": 123}. Up to 3 input images
and 4 outputs per request. Omit seed for a random one.
LOW_VRAM=1)pip install -r requirements.txt
python app.py # local inference
# or use a remote backend:
MODAL_ENDPOINT_URL=https://…modal.run python app.py
v23/Qwen-Rapid-AIO-NSFW-v23.safetensors (28.4 GB, FP8).
Phr00t's notes: v19 is best for edit consistency, v23 for prompt adherence;
each version has SFW and NSFW variants. Switch with the MODEL_URL variable.Python
100.0%