diff --git a/.env.example b/.env.example index 3b30a16..9e46d17 100644 --- a/.env.example +++ b/.env.example @@ -117,14 +117,20 @@ COMFYUI_PGID= HOST_VIDEO_GID= HOST_RENDER_GID= -# --- ComfyUI diffusion model (Qwen-Image, FP8 — see docs/research/ -# image-generation-model-choice.md and issue #42) --- -# Three files: diffusion weights, text encoder, VAE — all from the official -# Comfy-Org FP8 split, chosen specifically because it's the only candidate -# with a ComfyUI workflow pre-validated on this exact GPU (gfx1201/R9700). -COMFYUI_DIFFUSION_MODEL_FILE=qwen_image_fp8_e4m3fn.safetensors -COMFYUI_TEXT_ENCODER_FILE=qwen_2.5_vl_7b_fp8_scaled.safetensors -COMFYUI_VAE_FILE=qwen_image_vae.safetensors +# --- ComfyUI diffusion model (Qwen-Image 2.1, uncensored GGUF — see +# docs/research/image-generation-model-choice.md and issue #42) --- +# Three files, all from abenzerps/Qwen-Image-2.1-Uncensored-GGUF on +# HuggingFace: GGUF diffusion weights, safetensors text encoder, safetensors +# VAE. Q4_K_M is the repo's own recommended size/quality balance (~4.6GB); +# the int8 text encoder trades some quality for ~8GB less RAM than bf16. +# +# Requires the ComfyUI-GGUF custom node (github.com/city96/ComfyUI-GGUF) — +# NOT confirmed bundled in yurisasc/comfyui-rocm7.1. If the comfyui +# container doesn't show a "Unet Loader (GGUF)" node, `git clone` it into +# the image's custom_nodes dir and reinstall its requirements. +COMFYUI_DIFFUSION_MODEL_FILE=qwen-image-2.1-UC-Q4_K_M.gguf +COMFYUI_TEXT_ENCODER_FILE=qwen3vl_8b_int8_convrot.safetensors +COMFYUI_VAE_FILE=qwen_image_2.1_vae_bf16.safetensors # --- RAG databases (qdrant + neo4j, see wayfinder notes) --- # No auth on qdrant (its default) — same trust boundary as llama-server: diff --git a/docker-compose.yml b/docker-compose.yml index 6f4307c..90a60c4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -168,13 +168,19 @@ services: curl -L --fail --create-dirs -o /models/${LLAMA_CLASSIFIER_MODEL_FILE:-Qwen3-4B-Instruct-2507-UD-Q4_K_XL.gguf} https://huggingface.co/unsloth/Qwen3-4B-Instruct-2507-GGUF/resolve/main/${LLAMA_CLASSIFIER_MODEL_FILE:-Qwen3-4B-Instruct-2507-UD-Q4_K_XL.gguf} - # Fetches the three Qwen-Image FP8 files ComfyUI needs (diffusion model, - # text encoder, VAE) — same test -f guard pattern as downloader above. - # See docs/research/image-generation-model-choice.md and issue #42. + # Fetches the three Qwen-Image 2.1 (uncensored GGUF) files ComfyUI needs + # (diffusion model, text encoder, VAE) — same test -f guard pattern as + # downloader above. See docs/research/image-generation-model-choice.md and + # issue #42. # - # ponytail: target paths assume ComfyUI's standard models/ layout under - # BASE_STORAGE_PATH (/storage) — same "not independently confirmed against - # the image's Dockerfile" caveat already flagged on the comfyui service + # GGUF weights go in models/unet (ComfyUI-GGUF's own convention), not + # models/diffusion_models (that was the old FP8-safetensors layout) — see + # github.com/city96/ComfyUI-GGUF. Text encoder/VAE stay safetensors, loaded + # by ComfyUI's normal CLIPLoader/VAELoader, so their folders are unchanged. + # + # ponytail: target paths otherwise assume ComfyUI's standard models/ layout + # under BASE_STORAGE_PATH (/storage) — same "not independently confirmed + # against the image's Dockerfile" caveat flagged on the comfyui service # below. If ComfyUI doesn't pick these up, check its actual models root # first. downloader-comfyui: @@ -186,24 +192,30 @@ services: entrypoint: ["sh", "-c"] command: - > - mkdir -p /storage/models/diffusion_models /storage/models/text_encoders /storage/models/vae && - (test -f /storage/models/diffusion_models/${COMFYUI_DIFFUSION_MODEL_FILE:-qwen_image_fp8_e4m3fn.safetensors} && + mkdir -p /storage/models/unet /storage/models/text_encoders /storage/models/vae && + (test -f /storage/models/unet/${COMFYUI_DIFFUSION_MODEL_FILE:-qwen-image-2.1-UC-Q4_K_M.gguf} && echo "diffusion model already downloaded, skipping" || - curl -L --fail --create-dirs -o /storage/models/diffusion_models/${COMFYUI_DIFFUSION_MODEL_FILE:-qwen_image_fp8_e4m3fn.safetensors} - https://huggingface.co/Comfy-Org/Qwen-Image_ComfyUI/resolve/main/split_files/diffusion_models/${COMFYUI_DIFFUSION_MODEL_FILE:-qwen_image_fp8_e4m3fn.safetensors}) && - (test -f /storage/models/text_encoders/${COMFYUI_TEXT_ENCODER_FILE:-qwen_2.5_vl_7b_fp8_scaled.safetensors} && + curl -L --fail --create-dirs -o /storage/models/unet/${COMFYUI_DIFFUSION_MODEL_FILE:-qwen-image-2.1-UC-Q4_K_M.gguf} + https://huggingface.co/abenzerps/Qwen-Image-2.1-Uncensored-GGUF/resolve/main/${COMFYUI_DIFFUSION_MODEL_FILE:-qwen-image-2.1-UC-Q4_K_M.gguf}) && + (test -f /storage/models/text_encoders/${COMFYUI_TEXT_ENCODER_FILE:-qwen3vl_8b_int8_convrot.safetensors} && echo "text encoder already downloaded, skipping" || - curl -L --fail --create-dirs -o /storage/models/text_encoders/${COMFYUI_TEXT_ENCODER_FILE:-qwen_2.5_vl_7b_fp8_scaled.safetensors} - https://huggingface.co/Comfy-Org/Qwen-Image_ComfyUI/resolve/main/split_files/text_encoders/${COMFYUI_TEXT_ENCODER_FILE:-qwen_2.5_vl_7b_fp8_scaled.safetensors}) && - (test -f /storage/models/vae/${COMFYUI_VAE_FILE:-qwen_image_vae.safetensors} && + curl -L --fail --create-dirs -o /storage/models/text_encoders/${COMFYUI_TEXT_ENCODER_FILE:-qwen3vl_8b_int8_convrot.safetensors} + https://huggingface.co/abenzerps/Qwen-Image-2.1-Uncensored-GGUF/resolve/main/${COMFYUI_TEXT_ENCODER_FILE:-qwen3vl_8b_int8_convrot.safetensors}) && + (test -f /storage/models/vae/${COMFYUI_VAE_FILE:-qwen_image_2.1_vae_bf16.safetensors} && echo "vae already downloaded, skipping" || - curl -L --fail --create-dirs -o /storage/models/vae/${COMFYUI_VAE_FILE:-qwen_image_vae.safetensors} - https://huggingface.co/Comfy-Org/Qwen-Image_ComfyUI/resolve/main/split_files/vae/${COMFYUI_VAE_FILE:-qwen_image_vae.safetensors}) + curl -L --fail --create-dirs -o /storage/models/vae/${COMFYUI_VAE_FILE:-qwen_image_2.1_vae_bf16.safetensors} + https://huggingface.co/abenzerps/Qwen-Image-2.1-Uncensored-GGUF/resolve/main/${COMFYUI_VAE_FILE:-qwen_image_2.1_vae_bf16.safetensors}) # Local image generation — see issue #38 (wayfinder map). yurisasc's image # is gfx1201-tuned specifically (R9700's arch), unlike the official/AMD # ComfyUI image which doesn't pin RDNA4 support — see # docs/research/image-generation-options.md. + # + # Model is Qwen-Image 2.1 GGUF (uncensored variant, see .env.example) — + # needs the ComfyUI-GGUF custom node (github.com/city96/ComfyUI-GGUF) for + # its "Unet Loader (GGUF)" node. Not confirmed pre-installed in this image; + # if missing, exec in and `git clone` it into custom_nodes, then pip + # install its requirements.txt and restart the container. comfyui: image: yurisasc/comfyui-rocm7.1:latest container_name: comfyui