ComfyUI Setup: Docker Container + Native Install Combination

# ComfyUI on Jan's Machine: Docker + Native Combination

**Date:** 2026-08-21 · **Machine:** linux dev box (RTX 5060 Ti, 16 GB VRAM)

## What exists

| Component | Location | Version / Notes |
|---|---|---|
| Docker container `comfyui` | restart-policy container, port 8188 | ComfyUI **0.33.1** (current primary) |
| Native install | `~/src/comfyanonymous/ComfyUI` (git clone) | **v0.20.1-37** (older) |
| Bridge dir | `~/ComfyUI/` | mount-hub created May 3 — mixes real dirs and symlinks |
| Native venvs | `~/comfy-env/`, `~/comfy-envcd/` | both Python 3.14.4 |
| Models | `~/src/comfyanonymous/ComfyUI/models` | ~23 GB total |

## How they are already combined

`~/ComfyUI` is a bridge directory the Docker container mounts:

```
~/ComfyUI/models/checkpoints  (real dir, root-owned!)  -> container:/root/ComfyUI/models/checkpoints
~/ComfyUI/custom_nodes        -> symlink -> ~/src/comfyanonymous/ComfyUI/custom_nodes
~/ComfyUI/output              -> symlink -> ~/src/comfyanonymous/ComfyUI/output
```

Both installs effectively see the **same checkpoints** (FLUX.1-schnell fp8 17 GB, SDXL base),
the **same custom nodes** (ComfyUI-Manager) and write to the **same output folder**.
So: model downloads, generated images and node extensions are shared automatically.

## How to use it for other things

The container is a general image-generation service — anything scriptable via its HTTP API
(`POST http://localhost:8188/prompt` with a workflow JSON):

- **Claimcheck video pipeline:** Kai avatar (FLUX + SadTalker), studio backgrounds, chart styling
- **Thumbnails:** generate + iterate episode thumbnails from the episode title/claim
- **Upscaling / img2img refinements** of card art
- **Batch style experiments:** same workflow JSON with different seeds (see
  `/tmp/kilo/gen_kai*.py` for the API pattern — reusable as templates)

Example API pattern (used for Kai generation):
```python
workflow = {"4": {"class_type": "CheckpointLoaderSimple",
                  "inputs": {"ckpt_name": "flux1-schnell-fp8.safetensors"}}, ...}
requests.post("http://localhost:8188/prompt", json={"prompt": workflow, "client_id": uid})
# poll /history, fetch from output dir
```

## Running both simultaneously

Possible and sometimes useful (e.g., a custom node that only works natively):

```bash
cd ~/src/comfyanonymous/ComfyUI && ~/comfy-env/bin/python main.py --port 8189
```

- Container: port **8188** (primary, newer version)
- Native: port **8189** (only when needed; older v0.20.1 — update with `git pull` before serious use)
- VRAM is the constraint: **unload models on the idle instance** before starting the other
  (`POST /free {"unload_models": true}`) or OOM (seen in practice during SadTalker runs)

## Recommendations

1. **Keep the container as primary** — newer version, isolated deps, already proven with FLUX fp8.
2. **Single source of truth for models** stays `~/ComfyUI/models/*` (bridge) so both installs share.
3. **Fix ownership:** `~/ComfyUI/models/checkpoints` is root-owned (from a docker cp) —
   `sudo chown -R jan:jan ~/ComfyUI/models/checkpoints` when convenient; until then use
   `docker cp` or HF download to /tmp + copy.
4. **Update native install** (`git pull` + venv refresh) before relying on it, or retire it
   and keep only the container + bridge dirs.
5. **GPU discipline:** only one heavy model resident at a time (FLUX ≈ 8.6 GB, SadTalker ≈ 5 GB,
   Whisper ≈ 2 GB on the same GPU).

## Related

- Claimcheck avatar workflow: Joplin » Claimcheck » Workflows
- FLUX.1-schnell license: Apache 2.0 (commercial OK) — dev/pro variants are NOT

id: 989d584f04dd4759904dea8c28998522
parent_id: cd0501fe1cc24c93bc6bc3e78fb324fd
created_time: 2026-08-21T13:07:28.267Z
updated_time: 2026-08-21T13:07:28.267Z
is_conflict: 0
latitude: 0.00000000
longitude: 0.00000000
altitude: 0.0000
author: 
source_url: 
is_todo: 0
todo_due: 0
todo_completed: 0
source: joplin-desktop
source_application: net.cozic.joplin-desktop
application_data: 
order: 1787317648267
user_created_time: 2026-08-21T13:07:28.267Z
user_updated_time: 2026-08-21T13:07:28.267Z
encryption_cipher_text: 
encryption_applied: 0
markup_language: 1
is_shared: 0
share_id: 
conflict_original_id: 
master_key_id: 
user_data: 
deleted_time: 0
is_locked: 0
extracted_resource_ids: 
type_: 1