This commit is contained in:
mike
2026-06-21 04:21:40 +02:00
parent cfb2e45f1f
commit a5b83e6c77
9 changed files with 559 additions and 140 deletions

View File

@@ -1,81 +0,0 @@
# Qwen-Image-Edit Rapid-AIO v23 — headless edit API (tour / MI50)
Runs Phr00t's **Rapid-AIO NSFW v23** (the same tune as the gradio app) as a
**Q8 GGUF** on the AMD Instinct **MI50 32GB** (`tour`, gfx906, ROCm 5.7,
torch 2.3.1), served by ComfyUI behind a thin FastAPI throughput endpoint:
**image + prompt in → edited PNG out**.
## Layout on `tour`
```
/media/tour/APPS/comfyui/
venv/ torch 2.3.1+rocm5.7 + ComfyUI deps
ComfyUI/ backend + ComfyUI-GGUF custom node
models/unet/Qwen-Rapid-NSFW-v23_Q8_0.gguf (21.8 GB)
models/text_encoders/qwen_2.5_vl_7b_fp8_scaled.safetensors (9.4 GB)
models/vae/qwen_image_vae.safetensors (0.25 GB)
api/ edit_api.py + workflow + scripts
```
## Run
```bash
# 1) backend (terminal 1)
/media/tour/APPS/comfyui/api/run_comfyui.sh
# 2) API (terminal 2)
/media/tour/APPS/comfyui/api/start_api.sh
```
## Use
```bash
curl -s -X POST http://192.168.1.160:8500/edit \
-F image=@car.png \
-F 'prompt=put the car on a beach at sunset' \
-F seed=-1 -F steps=4 \
-o out.png
```
Form fields: `prompt` (required), `seed` (-1 = random), `steps` (4),
`cfg` (1.0), `sampler_name` (euler_ancestral), `scheduler` (beta),
`max_area` (px, 0 = server default ~1MP). Response headers expose
`X-Seed`, `X-Width`, `X-Height`.
Settings match Phr00t's v23 recommendation: **euler_ancestral / beta, 4 steps,
CFG 1**. Output size tracks the input aspect ratio, scaled to `MAX_AREA`.
## Performance (MI50, gfx906, 4 steps)
Compute-bound — the 20.8GB unet stays resident; only the text encoder swaps.
| Output budget | Latency |
|---------------|---------|
| 0.59 MP | ~110 s |
| 0.79 MP (default) | ~140 s |
| 1.0 MP | ~180 s |
## Gotchas (why it's built this way)
- **ComfyUI pinned to `v0.3.77`.** `master` imports `comfy_kitchen`, which needs
`torch.library.custom_op` (torch ≥ 2.4). gfx906/ROCm-5.7 tops out at the proven
`torch 2.3.1+rocm5.7`, so newer ComfyUI won't import. v0.3.77 is the newest tag
that still has `TextEncodeQwenImageEditPlus` without that dependency.
- **`--use-split-cross-attention`** (in `run_comfyui.sh`) is required: the default
pytorch attention path OOMs a 20B edit model on 32GB. Split attention chunks the
attention matmul so it fits.
- The audio custom-node import errors in the ComfyUI log (`libcudart.so.13`) are
harmless — a CUDA `torchaudio` got pulled in; image editing doesn't use it.
## Manage (local machine)
From this machine, use the `deploy_api.sh` script:
```bash
cd tour-comfy
./deploy_api.sh deploy tour # sync files and (re)start services
./deploy_api.sh stop tour # stop and disable services
./deploy_api.sh status tour # check service status and logs
```
## Manage (on `tour`)
```bash
sudo bash /media/tour/APPS/comfyui/api/deploy.sh # (re)install and start services
sudo bash /media/tour/APPS/comfyui/api/stop.sh # stop and disable services
```
### Logs
```bash
journalctl -u comfyui-backend -f
journalctl -u comfyui-api -f
```

View File

@@ -9,6 +9,9 @@ realistic, transparent background
1 female nude.
realistic.
# Feminine NO BG
1 female nude.
realistic, transparent background
# Upscale HQ Feminine
high quality.

View File

@@ -2034,3 +2034,39 @@ SyntaxError: broken PNG file (chunk b'END\xae')
2026-06-19 23:45:09,379 - INFO - Watcher started. Monitoring /mnt/zim/tour-comfy/stage...
2026-06-19 23:45:09,379 - INFO - Output directory: /mnt/zim/tour-comfy/output
2026-06-19 23:45:09,379 - INFO - API URL: http://127.0.0.1:8500/edit
2026-06-20 03:36:11,495 - INFO - Watcher started. Monitoring /mnt/zim/tour-comfy/stage...
2026-06-20 03:36:11,495 - INFO - Output directory: /mnt/zim/tour-comfy/output
2026-06-20 03:36:11,495 - INFO - API URL: http://127.0.0.1:8500/edit
2026-06-20 03:46:05,968 - INFO - Watcher started. Monitoring /mnt/zim/tour-comfy/stage...
2026-06-20 03:46:05,968 - INFO - Output directory: /mnt/zim/tour-comfy/output
2026-06-20 03:46:05,968 - INFO - API URL: http://127.0.0.1:8500/edit
2026-06-20 04:34:43,767 - INFO - Watcher started. Monitoring /mnt/zim/tour-comfy/stage...
2026-06-20 04:34:43,767 - INFO - Output directory: /mnt/zim/tour-comfy/output
2026-06-20 04:34:43,767 - INFO - API URL: http://127.0.0.1:8500/edit
2026-06-20 05:23:14,220 - INFO - Watcher started. Monitoring /mnt/zim/tour-comfy/stage...
2026-06-20 05:23:14,220 - INFO - Output directory: /mnt/zim/tour-comfy/output
2026-06-20 05:23:14,220 - INFO - API URL: http://127.0.0.1:8500/edit
2026-06-20 05:47:31,635 - INFO - Watcher started. Monitoring /mnt/zim/tour-comfy/stage...
2026-06-20 05:47:31,635 - INFO - Output directory: /mnt/zim/tour-comfy/output
2026-06-20 05:47:31,635 - INFO - API URL: http://127.0.0.1:8500/edit
2026-06-20 15:24:51,866 - INFO - Watcher started. Monitoring /mnt/zim/tour-comfy/stage...
2026-06-20 15:24:51,866 - INFO - Output directory: /mnt/zim/tour-comfy/output
2026-06-20 15:24:51,866 - INFO - API URL: http://127.0.0.1:8500/edit
2026-06-20 15:42:57,259 - INFO - Watcher started. Monitoring /mnt/zim/tour-comfy/stage...
2026-06-20 15:42:57,259 - INFO - Output directory: /mnt/zim/tour-comfy/output
2026-06-20 15:42:57,259 - INFO - API URL: http://127.0.0.1:8500/edit
2026-06-20 16:14:06,428 - INFO - Watcher started. Monitoring /mnt/zim/tour-comfy/stage...
2026-06-20 16:14:06,428 - INFO - Output directory: /mnt/zim/tour-comfy/output
2026-06-20 16:14:06,428 - INFO - API URL: http://127.0.0.1:8500/edit
2026-06-20 16:17:07,087 - INFO - Watcher started. Monitoring /mnt/zim/tour-comfy/stage...
2026-06-20 16:17:07,088 - INFO - Output directory: /mnt/zim/tour-comfy/output
2026-06-20 16:17:07,088 - INFO - API URL: http://127.0.0.1:8500/edit
2026-06-20 16:20:59,203 - INFO - Watcher started. Monitoring /mnt/zim/tour-comfy/stage...
2026-06-20 16:20:59,204 - INFO - Output directory: /mnt/zim/tour-comfy/output
2026-06-20 16:20:59,204 - INFO - API URL: http://127.0.0.1:8500/edit
2026-06-21 00:11:13,229 - INFO - Watcher started. Monitoring /mnt/zim/tour-comfy/stage...
2026-06-21 00:11:13,229 - INFO - Output directory: /mnt/zim/tour-comfy/output
2026-06-21 00:11:13,229 - INFO - API URL: http://127.0.0.1:8500/edit
2026-06-21 04:05:41,577 - INFO - Watcher started. Monitoring /mnt/zim/tour-comfy/stage...
2026-06-21 04:05:41,578 - INFO - Output directory: /mnt/zim/tour-comfy/output
2026-06-21 04:05:41,578 - INFO - API URL: http://127.0.0.1:8500/edit