# comfyui-mcp RunPod image — extra model paths (FAST-RESTART design).
# =============================================================================
# Baked into the image at /opt/ComfyUI/extra_model_paths.yaml and loaded at
# launch via:  main.py --extra-model-paths-config /opt/ComfyUI/extra_model_paths.yaml
#
# WHY: ComfyUI software (install + venv + custom_nodes) lives in the IMMUTABLE
# image at /opt/ComfyUI. ONLY user data lives on the /workspace network volume.
# This file points EVERY model category at /workspace/models/<cat> so:
#   * your models persist across stop/start (they're on the volume), and
#   * Manager's install-model writes downloads to the volume — NOT to the image.
#
# `is_default: true` makes these paths the PRIMARY entries (inserted at the FRONT
# of each category's folder list via folder_paths.add_model_folder_path), so they
# become the DEFAULT download target. Without it, ComfyUI's built-in
# /opt/ComfyUI/models/<cat> (ephemeral, in the image) would stay first and
# Manager downloads would NOT persist.
#
# NOTE: there is deliberately NO `custom_nodes:` key here. custom_nodes must stay
# in the image (immutable software). Mapping custom_nodes to the volume would
# defeat the fast-restart design and the image-baked-nodes contract.
#
# base_path is /workspace, and each value is relative to it (matching ComfyUI's
# own extra_model_paths.yaml.example convention, e.g. `models/checkpoints/`).
# Category KEYS match ComfyUI's folder_names_and_paths keys exactly.
# =============================================================================

comfyui_mcp_volume:
    base_path: /workspace
    is_default: true

    checkpoints: models/checkpoints/
    configs: models/configs/
    loras: models/loras/
    vae: models/vae/
    text_encoders: |
        models/text_encoders/
        models/clip/
    diffusion_models: |
        models/diffusion_models/
        models/unet/
    clip_vision: models/clip_vision/
    style_models: models/style_models/
    embeddings: models/embeddings/
    diffusers: models/diffusers/
    vae_approx: models/vae_approx/
    controlnet: |
        models/controlnet/
        models/t2i_adapter/
    gligen: models/gligen/
    upscale_models: models/upscale_models/
    latent_upscale_models: models/latent_upscale_models/
    hypernetworks: models/hypernetworks/
    photomaker: models/photomaker/
    classifiers: models/classifiers/
    model_patches: models/model_patches/
    audio_encoders: models/audio_encoders/
    background_removal: models/background_removal/
    frame_interpolation: models/frame_interpolation/
    geometry_estimation: models/geometry_estimation/
    optical_flow: models/optical_flow/
    detection: models/detection/

    # Impact Pack / Impact Subpack register these categories THEMSELVES at import
    # time (Subpack: ultralytics, ultralytics_bbox, ultralytics_segm — Pack: sams),
    # so without the entries below the categories exist only as the in-image
    # /opt/ComfyUI/models/<cat> and a FaceDetailer user's YOLO/SAM weights land on
    # the ephemeral layer and vanish on the next rebuild (#2302).
    #
    # Order is safe either way round: both packs register via a helper that calls
    # folder_paths.add_model_folder_path WITHOUT is_default, i.e. it APPENDS. So if
    # this file loads first the volume path is already index 0 and the pack appends
    # behind it; if the pack loads first, `is_default: true` above inserts the
    # volume path at the FRONT. Either way /workspace stays the download target.
    ultralytics: models/ultralytics/
    ultralytics_bbox: models/ultralytics/bbox/
    ultralytics_segm: models/ultralytics/segm/
    sams: models/sams/
