# ERNIE-Image Ultra install manifest — consumable by apply_manifest (src/services/manifest.ts).
# Ground truth: ERNIE-IMAGE_ULTRA-MODELS-NODES_INSTALL.bat (cross-checked against
# ...-COMFYUI-MANAGER_AUTO_INSTALL.bat, ...-AUTO_INSTALL-RUNPOD.sh, and the workflow).
# Mirror base: https://huggingface.co/Aitrepreneur/FLX/resolve/main  (third-party mirror)
# Official weights: https://huggingface.co/Comfy-Org/ERNIE-Image  (same filenames, Apache-2.0)
#
# NOTE: this workflow is more than plain ERNIE — 10 of its 20 groups are
# ERNIE×Z-Image-Turbo COMBO pipelines ("ZIT ---> ERNIE", "TWO TIMES COMBO ERNIE
# ZIT", etc.). Those groups need the Z-Image-Turbo models too, so the z-image
# UNet/CLIP/VAE are downloaded below alongside the ERNIE set. The combo groups
# ship bypassed; a user toggles them on via the rgthree group bypassers.

# comfyui-vrgamedevgirl's nodes.py (FastFilmGrain / FastLaplacianSharpen, used by
# the GRAIN/SHARP post-processing groups) imports librosa at module load. It IS
# in that pack's requirements.txt but can fail to build silently on py3.13, which
# de-registers ALL of nodes.py — so pin it here to guarantee the post-proc nodes load.
pip:
  - librosa

custom_nodes:
  - https://github.com/city96/ComfyUI-GGUF
  - https://github.com/rgthree/rgthree-comfy
  - https://github.com/yolain/ComfyUI-Easy-Use
  - https://github.com/kijai/ComfyUI-KJNodes
  - https://github.com/cubiq/ComfyUI_essentials
  - https://github.com/wallish77/wlsh_nodes
  - https://github.com/vrgamegirl19/comfyui-vrgamedevgirl
  - https://github.com/ClownsharkBatwing/RES4LYF

models:
  # --- UNet (GGUF) — ERNIE-Image-Turbo DiT ---
  # Quant guidance from installer: Q5_K_S <8GB · Q6_K 8-12GB · Q8_0 12-16GB+.
  # Workflow ships the Q8_0 variant; swap the quant in the filename for smaller VRAM.
  - url: https://huggingface.co/Aitrepreneur/FLX/resolve/main/ernie-image-turbo-Q8_0.gguf
    local_path: unet/ernie-image-turbo-Q8_0.gguf

  # --- Text encoder — Ministral-3-3B (loaded with CLIP type flux2) ---
  - url: https://huggingface.co/Aitrepreneur/FLX/resolve/main/ministral-3-3b.safetensors
    local_path: text_encoders/ministral-3-3b.safetensors

  # --- Prompt enhancer — 3B LLM that auto-expands short prompts (optional, toggled per-pipeline) ---
  - url: https://huggingface.co/Aitrepreneur/FLX/resolve/main/ernie-image-prompt-enhancer.safetensors
    local_path: text_encoders/ernie-image-prompt-enhancer.safetensors

  # --- VAE — ERNIE reuses the Flux 2 VAE ---
  - url: https://huggingface.co/Aitrepreneur/FLX/resolve/main/flux2-vae.safetensors
    local_path: vae/flux2-vae.safetensors

  # --- Z-Image-Turbo models — required by the ERNIE×ZIT COMBO groups (workflow
  #     nodes 65/66/67). Same files the standalone z-image-turbo pack ships;
  #     the VAE is saved as z-image-ae.safetensors to avoid colliding with the
  #     Flux/ERNIE VAEs (its weights differ despite the same size). ---
  - url: https://huggingface.co/Aitrepreneur/FLX/resolve/main/z_image_turbo-Q8_0.gguf
    local_path: unet/z_image_turbo-Q8_0.gguf
  - url: https://huggingface.co/Aitrepreneur/FLX/resolve/main/Qwen3-4B-UD-Q6_K_XL.gguf
    local_path: text_encoders/Qwen3-4B-UD-Q6_K_XL.gguf
  - url: https://huggingface.co/Aitrepreneur/FLX/resolve/main/ae.safetensors
    local_path: vae/z-image-ae.safetensors

  # --- Upscaler (used by the workflow's SIMPLE UPSCALE / UpscaleModelLoader) ---
  - url: https://huggingface.co/Aitrepreneur/FLX/resolve/main/4x-ClearRealityV1.pth
    local_path: upscale_models/4x-ClearRealityV1.pth
  - url: https://huggingface.co/Aitrepreneur/FLX/resolve/main/RealESRGAN_x4plus_anime_6B.pth
    local_path: upscale_models/RealESRGAN_x4plus_anime_6B.pth  # verify: in installer but not referenced by the ERNIE workflow
