目录结构

├── build.sh
├── checkpoints
│ ├── sd_xl_base_1.0_0.9vae.safetensors
│ └── SUPIR-v0Q.ckpt
├── Dockerfile
├── push.sh
└── workflows
└── SUPIR图片修复.json

打包方法

根据需求修改build.sh并执行即可

文件内容

build.sh

# 打包并指定镜像名与tag
sudo docker build -t supir_upscale:1.0.0 .

checkpoints

sd_xl_base_1.0_0.9vae.safetensors

下载地址:
https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/sd_xl_base_1.0_0.9vae.safetensors

SUPIR-v0Q.ckpt

下载地址:
https://huggingface.co/camenduru/SUPIR/blob/main/SUPIR-v0Q.ckpt

Dockerfile

# 使用 comfyui-api 基础镜像
FROM ghcr.io/saladtechnologies/comfyui-api:comfy0.3.67-api1.13.5-torch2.8.0-cuda12.8-runtime

# 设置环境变量
ENV COMFYUI_PORT=8188 \
    MODEL_DIR=/opt/ComfyUI/models \
    CUSTOM_NODES=/opt/ComfyUI/custom_nodes \
    BASE=""
RUN pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple

# 安装自定义节点
WORKDIR /opt/ComfyUI/custom_nodes/
RUN git clone https://ghfast.top/https://github.com/kijai/ComfyUI-SUPIR.git && \
    pip install -r ComfyUI-SUPIR/requirements.txt && \
    git clone https://ghfast.top/https://github.com/rgthree/rgthree-comfy.git 

# 复制模型文件和工作流  
COPY checkpoints/*.ckpt ${MODEL_DIR}/checkpoints/
COPY checkpoints/*.safetensors ${MODEL_DIR}/checkpoints/
COPY workflows/*.json /opt/ComfyUI/user/default/workflows/

WORKDIR /opt/ComfyUI/
# 暴露端口
EXPOSE ${COMFYUI_PORT}
RUN chmod +x comfyui-api

CMD ["./comfyui-api"]

push.sh

# 示例
sudo docker push supir_upscale:1.0.0

workflows

SUPIR图片修复.json

{
  "id": "7fed9220-c414-468c-9faf-94c5a6cbc2b9",
  "revision": 0,
  "last_node_id": 33,
  "last_link_id": 75,
  "nodes": [
    {
      "id": 5,
      "type": "SUPIR_conditioner",
      "pos": [
        863,
        168
      ],
      "size": [
        401.8096008300781,
        249.17234802246094
      ],
      "flags": {},
      "order": 5,
      "mode": 0,
      "inputs": [
        {
          "label": "SUPIR_model",
          "name": "SUPIR_model",
          "type": "SUPIRMODEL",
          "link": 9
        },
        {
          "label": "Latent",
          "name": "latents",
          "type": "LATENT",
          "link": 8
        },
        {
          "label": "captions",
          "name": "captions",
          "shape": 7,
          "type": "STRING",
          "link": null
        }
      ],
      "outputs": [
        {
          "label": "正面条件",
          "name": "positive",
          "type": "SUPIR_cond_pos",
          "slot_index": 0,
          "links": [
            12
          ]
        },
        {
          "label": "负面条件",
          "name": "negative",
          "type": "SUPIR_cond_neg",
          "slot_index": 1,
          "links": [
            13
          ]
        }
      ],
      "properties": {
        "Node name for S&R": "SUPIR_conditioner"
      },
      "widgets_values": [
        "high quality, detailed",
        "bad quality, blurry, messy"
      ]
    },
    {
      "id": 6,
      "type": "SUPIR_sample",
      "pos": [
        1297,
        -12
      ],
      "size": [
        315,
        454
      ],
      "flags": {},
      "order": 6,
      "mode": 0,
      "inputs": [
        {
          "label": "SUPIR模型",
          "name": "SUPIR_model",
          "type": "SUPIRMODEL",
          "link": 11
        },
        {
          "label": "Latent",
          "name": "latents",
          "type": "LATENT",
          "link": 10
        },
        {
          "label": "正面条件",
          "name": "positive",
          "type": "SUPIR_cond_pos",
          "link": 12
        },
        {
          "label": "负面条件",
          "name": "negative",
          "type": "SUPIR_cond_neg",
          "link": 13
        }
      ],
      "outputs": [
        {
          "label": "Latent",
          "name": "latent",
          "type": "LATENT",
          "slot_index": 0,
          "links": [
            14
          ]
        }
      ],
      "properties": {
        "Node name for S&R": "SUPIR_sample"
      },
      "widgets_values": [
        133626942765759,
        "randomize",
        35,
        7,
        7,
        1,
        1.0030000000000001,
        0.1,
        1,
        1,
        5,
        false,
        "RestoreDPMPP2MSampler",
        1024,
        512
      ]
    },
    {
      "id": 7,
      "type": "SUPIR_decode",
      "pos": [
        1680,
        -10
      ],
      "size": [
        315,
        102
      ],
      "flags": {},
      "order": 7,
      "mode": 0,
      "inputs": [
        {
          "label": "SUPIR_VAE",
          "name": "SUPIR_VAE",
          "type": "SUPIRVAE",
          "link": 15
        },
        {
          "label": "Latent",
          "name": "latents",
          "type": "LATENT",
          "link": 14
        }
      ],
      "outputs": [
        {
          "label": "image",
          "name": "image",
          "type": "IMAGE",
          "slot_index": 0,
          "links": [
            60,
            70
          ]
        }
      ],
      "properties": {
        "Node name for S&R": "SUPIR_decode"
      },
      "widgets_values": [
        true,
        512
      ]
    },
    {
      "id": 1,
      "type": "CheckpointLoaderSimple",
      "pos": [
        -264,
        45
      ],
      "size": [
        315,
        98
      ],
      "flags": {},
      "order": 0,
      "mode": 0,
      "inputs": [],
      "outputs": [
        {
          "label": "模型",
          "name": "MODEL",
          "type": "MODEL",
          "slot_index": 0,
          "links": [
            67
          ]
        },
        {
          "label": "CLIP",
          "name": "CLIP",
          "type": "CLIP",
          "slot_index": 1,
          "links": [
            68
          ]
        },
        {
          "label": "VAE",
          "name": "VAE",
          "type": "VAE",
          "slot_index": 2,
          "links": [
            3
          ]
        }
      ],
      "properties": {
        "Node name for S&R": "CheckpointLoaderSimple"
      },
      "widgets_values": [
        "sd_xl_base_1.0_0.9vae.safetensors"
      ]
    },
    {
      "id": 30,
      "type": "PreviewImage",
      "pos": [
        1644.077392578125,
        544.9227905273438
      ],
      "size": [
        510,
        480
      ],
      "flags": {},
      "order": 8,
      "mode": 0,
      "inputs": [
        {
          "label": "图像",
          "name": "images",
          "type": "IMAGE",
          "link": 60
        }
      ],
      "outputs": [],
      "properties": {
        "Node name for S&R": "PreviewImage"
      },
      "widgets_values": []
    },
    {
      "id": 2,
      "type": "SUPIR_model_loader_v2",
      "pos": [
        140,
        10
      ],
      "size": [
        315,
        170
      ],
      "flags": {},
      "order": 2,
      "mode": 0,
      "inputs": [
        {
          "label": "模型",
          "name": "model",
          "type": "MODEL",
          "link": 67
        },
        {
          "label": "CLIP",
          "name": "clip",
          "type": "CLIP",
          "link": 68
        },
        {
          "label": "VAE",
          "name": "vae",
          "type": "VAE",
          "link": 3
        }
      ],
      "outputs": [
        {
          "label": "SUPIR_model",
          "name": "SUPIR_model",
          "type": "SUPIRMODEL",
          "slot_index": 0,
          "links": [
            9,
            11
          ]
        },
        {
          "label": "SUPIR_VAE",
          "name": "SUPIR_VAE",
          "type": "SUPIRVAE",
          "slot_index": 1,
          "links": [
            5,
            15
          ]
        }
      ],
      "properties": {
        "Node name for S&R": "SUPIR_model_loader_v2"
      },
      "widgets_values": [
        "SUPIR-v0Q.ckpt",
        false,
        "auto",
        false
      ]
    },
    {
      "id": 3,
      "type": "SUPIR_first_stage",
      "pos": [
        500,
        0
      ],
      "size": [
        330,
        170
      ],
      "flags": {},
      "order": 3,
      "mode": 0,
      "inputs": [
        {
          "label": "SUPIR_VAE",
          "name": "SUPIR_VAE",
          "type": "SUPIRVAE",
          "link": 5
        },
        {
          "label": "图像",
          "name": "image",
          "type": "IMAGE",
          "link": 74
        }
      ],
      "outputs": [
        {
          "label": "SUPIR_VAE",
          "name": "SUPIR_VAE",
          "type": "SUPIRVAE",
          "slot_index": 0,
          "links": [
            6
          ]
        },
        {
          "label": "图像",
          "name": "denoised_image",
          "type": "IMAGE",
          "slot_index": 1,
          "links": [
            7
          ]
        },
        {
          "label": "Latent",
          "name": "denoised_latents",
          "type": "LATENT",
          "slot_index": 2,
          "links": [
            8
          ]
        }
      ],
      "properties": {
        "Node name for S&R": "SUPIR_first_stage"
      },
      "widgets_values": [
        true,
        512,
        512,
        "auto"
      ]
    },
    {
      "id": 4,
      "type": "SUPIR_encode",
      "pos": [
        900,
        0
      ],
      "size": [
        315,
        126
      ],
      "flags": {},
      "order": 4,
      "mode": 0,
      "inputs": [
        {
          "label": "SUPIR_VAE",
          "name": "SUPIR_VAE",
          "type": "SUPIRVAE",
          "link": 6
        },
        {
          "label": "图像",
          "name": "image",
          "type": "IMAGE",
          "link": 7
        }
      ],
      "outputs": [
        {
          "label": "Latent",
          "name": "latent",
          "type": "LATENT",
          "slot_index": 0,
          "links": [
            10
          ]
        }
      ],
      "properties": {
        "Node name for S&R": "SUPIR_encode"
      },
      "widgets_values": [
        true,
        512,
        "auto"
      ]
    },
    {
      "id": 11,
      "type": "LoadImage",
      "pos": [
        -179.33074951171875,
        546.49365234375
      ],
      "size": [
        530,
        500
      ],
      "flags": {},
      "order": 1,
      "mode": 0,
      "inputs": [],
      "outputs": [
        {
          "label": "图像",
          "name": "IMAGE",
          "type": "IMAGE",
          "slot_index": 0,
          "links": [
            74,
            75
          ]
        },
        {
          "label": "遮罩",
          "name": "MASK",
          "type": "MASK",
          "slot_index": 1,
          "links": []
        }
      ],
      "properties": {
        "Node name for S&R": "LoadImage"
      },
      "widgets_values": [
        "头像.jpg",
        "image"
      ]
    },
    {
      "id": 32,
      "type": "Image Comparer (rgthree)",
      "pos": [
        667.4326171875,
        559.6066284179688
      ],
      "size": [
        580,
        500
      ],
      "flags": {},
      "order": 9,
      "mode": 0,
      "inputs": [
        {
          "dir": 3,
          "label": "图像_A",
          "name": "image_a",
          "type": "IMAGE",
          "link": 75
        },
        {
          "dir": 3,
          "label": "图像_B",
          "name": "image_b",
          "type": "IMAGE",
          "link": 70
        }
      ],
      "outputs": [],
      "properties": {
        "comparer_mode": "Slide"
      },
      "widgets_values": [
        [
          {
            "name": "A",
            "selected": true,
            "url": "/api/view?filename=rgthree.compare._temp_fsyzq_00011_.png&type=temp&subfolder=&rand=0.5998638150769265"
          },
          {
            "name": "B",
            "selected": true,
            "url": "/api/view?filename=rgthree.compare._temp_fsyzq_00012_.png&type=temp&subfolder=&rand=0.519298554867785"
          }
        ]
      ]
    }
  ],
  "links": [
    [
      3,
      1,
      2,
      2,
      2,
      "VAE"
    ],
    [
      5,
      2,
      1,
      3,
      0,
      "SUPIRVAE"
    ],
    [
      6,
      3,
      0,
      4,
      0,
      "SUPIRVAE"
    ],
    [
      7,
      3,
      1,
      4,
      1,
      "IMAGE"
    ],
    [
      8,
      3,
      2,
      5,
      1,
      "LATENT"
    ],
    [
      9,
      2,
      0,
      5,
      0,
      "SUPIRMODEL"
    ],
    [
      10,
      4,
      0,
      6,
      1,
      "LATENT"
    ],
    [
      11,
      2,
      0,
      6,
      0,
      "SUPIRMODEL"
    ],
    [
      12,
      5,
      0,
      6,
      2,
      "SUPIR_cond_pos"
    ],
    [
      13,
      5,
      1,
      6,
      3,
      "SUPIR_cond_neg"
    ],
    [
      14,
      6,
      0,
      7,
      1,
      "LATENT"
    ],
    [
      15,
      2,
      1,
      7,
      0,
      "SUPIRVAE"
    ],
    [
      60,
      7,
      0,
      30,
      0,
      "IMAGE"
    ],
    [
      67,
      1,
      0,
      2,
      0,
      "MODEL"
    ],
    [
      68,
      1,
      1,
      2,
      1,
      "CLIP"
    ],
    [
      70,
      7,
      0,
      32,
      1,
      "IMAGE"
    ],
    [
      74,
      11,
      0,
      3,
      1,
      "IMAGE"
    ],
    [
      75,
      11,
      0,
      32,
      0,
      "IMAGE"
    ]
  ],
  "groups": [],
  "config": {},
  "extra": {
    "ds": {
      "scale": 0.5445000000000021,
      "offset": [
        1083.227789030714,
        380.61478714086456
      ]
    },
    "frontendVersion": "1.23.4"
  },
  "version": 0.4
}
Logo

火山引擎开发者社区是火山引擎打造的AI技术生态平台,聚焦Agent与大模型开发,提供豆包系列模型(图像/视频/视觉)、智能分析与会话工具,并配套评测集、动手实验室及行业案例库。社区通过技术沙龙、挑战赛等活动促进开发者成长,新用户可领50万Tokens权益,助力构建智能应用。

更多推荐