基于nvidia/cuda镜像,以build模式生成开发环境(预装python3.12、vscode中文语言包、aria2c下载工具等)。之后生成venv并预装torch、flash_attn、sageattention等库。预装部分ComfyUI热门插件,并提供基于Gradio的图形化下载工具。
目前配置为从镜像启动。如需要每次启动重新构建docker环境可以自行修改 .cnb.yml 文件,重新构建的环境不含venv和ComfyUI,可参考venv生成方法和安装ComfyUI及插件。
相关项目链接:ComfyUI 在线体验(飞桨AI Studio星河社区)
新增模型自动下载功能,ComfyUI启动后界面内可选择的模型在运行时会自动下载到云节点缓存,无需人为操作,也不需要保存到个人仓库!!!
详细代码实现见ComfyUI源码修改,开源项目欢迎复制/参考代码,但希望注明代码出处~
注意:
自动下载功能是修改ComfyUI源码实现的,如果自行更新ComfyUI,可能会失去自动下载功能!!!
目前自动下载功能包括checkpoints、clip、clip_vision、controlnet、diffusion_models、loras、text_encoders、upscale_models、vae文件夹~
对于插件需要的模型暂不支持自动下载,主要是插件有自己的模型查找方式,不一定调用ComfyUI底层提供的模型查找函数。
预置模型来源于AI Models、ComfyUI-yi_dian_tong,不可商用!不可商用!不可商用!
环境启动后会自动启动ComfyUI。如需关闭,终端中按Ctrl+c。
再次启动ComfyUI,终端输入 qd,回车运行。可添加其他启动参数,如 qd --use-sage-attention,启用sageattention。
注意:--listen、--auto-launch参数已内置,无需额外添加。
四种打开外链的方法(选一种即可):

首先点击右下角 + 打开第二个终端,在新终端中输入 ui,回车运行,将自动打开下载工具界面。如需关闭,对应终端中按Ctrl+c。

Gradio下载工具界面:

预设下载模块中预置了一些模型的下载链接和存放路径,首先选择一级分类和二级分类,然后选择预设文件列表(可多选),最后点击开始下载或生成终端下载代码。
Aria2c和Wget模块均可自定义下载链接和保存路径,对于多数下载链接可以直接识别文件名,无法识别的需要手工输入。
注意:
提交文件或文件夹(终端内运行):
# add 文件或文件夹的路径1 文件或文件夹的路径2 文件或文件夹的路径3 ... # 例如提交comfyui、custom_nodes、venv文件夹 add comfyui custom_nodes venv
注意:可在资源管理器内,右键文件或文件夹,复制路径。
删除文件或文件夹(终端内运行,谨慎操作!):
del 文件或文件夹的路径1 文件或文件夹的路径2 文件或文件夹的路径3 ...
终端内运行:update
预设下载中有的模型尽量不要提交到自己的仓库,预设链接是内网链接,下载很快。免费空间只有100+100GB,只要提交文件就会占用空间,后续即使删除文件,空间占用不会降低。需要释放仓库空间只能是删除仓库(注意下载备份重要文件!)。
# 生成venv python3 -m venv venv # 激活venv source venv/bin/activate # 安装pytorch(注意cuda版本) pip install torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1 --index-url https://download.pytorch.org/whl/cu128 # pip install torch==2.8.0 torchvision==0.23.0 torchaudio==2.8.0 --index-url https://download.pytorch.org/whl/cu129 # 安装dev版本的pytorch(注意cuda版本) pip install -U torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu129 # 安装xformers(注意cuda版本,低版本pytorch需要手工指定xformers版本) pip install xformers --index-url https://download.pytorch.org/whl/cu128 # pytorch版本 xformers版本对照表(仅供参考) # torch==2.8.0 torchvision==0.23.0 torchaudio==2.8.0 xformers==0.0.32.post2 # torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1 xformers==0.0.31.post1 # torch==2.7.0 torchvision==0.22.0 torchaudio==2.7.0 xformers==0.0.30 # torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0 xformers==0.0.29.post2 # torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 xformers==0.0.28.post3 # torch==2.5.0 torchvision==0.20.0 torchaudio==2.5.0 xformers==0.0.28.post2 # torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1 xformers==0.0.28.post1 # torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 xformers==0.0.27.post2 # torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 xformers==0.0.27 # torch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0 xformers==0.0.26.post1 # torch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 xformers==0.0.26 # torch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 xformers==0.0.25 # torch==2.2.0 torchvision==0.17.0 torchaudio==2.2.0 xformers==0.0.24 # torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 xformers==0.0.23.post1 # torch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 xformers==0.0.23 # torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 xformers==0.0.22.post7 # torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 无xformers # torch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1 无xformers # 从源码安装xformers(pip安装的版本有问题时可尝试,低版本torch需要自己找低版本xformers源码) git clone https://github.com/facebookresearch/xformers.git cd xformers git submodule update --init --recursive python setup.py install cd .. # 安装flash-attn(具体版本得看插件要求) pip install flash-attn==2.8.0.post2 # 安装SageAttention git clone https://github.com/thu-ml/SageAttention.git cd SageAttention export EXT_PARALLEL=4 NVCC_APPEND_FLAGS="--threads 8" MAX_JOBS=32 # parallel compiling (Optional) python setup.py install cd ..
# 下载ComfyUI git clone https://github.com/comfyanonymous/ComfyUI.git /workspace/comfyui # 下载常用插件 cd /workspace/custom_nodes git clone https://github.com/1038lab/ComfyUI-RMBG git clone https://github.com/7BEII/Comfyui_PDuse git clone https://github.com/Acly/comfyui-inpaint-nodes git clone https://github.com/AIFSH/ComfyUI-UVR5 git clone https://github.com/AInseven/ComfyUI-fastblend git clone https://github.com/AIrjen/OneButtonPrompt git clone https://github.com/badxprogramm/ComfyUI-GradientBlur git clone https://github.com/BlenderNeko/ComfyUI_ADV_CLIP_emb git clone https://github.com/bronkula/comfyui-fitsize git clone https://github.com/catscandrive/comfyui-imagesubfolders git clone https://github.com/chflame163/ComfyUI_FaceSimilarity git clone https://github.com/chflame163/ComfyUI_LayerStyle git clone https://github.com/chflame163/ComfyUI_LayerStyle_Advance git clone https://github.com/chrisgoringe/cg-image-filter git clone https://github.com/chrisgoringe/cg-use-everywhere git clone https://github.com/christian-byrne/audio-separation-nodes-comfyui git clone https://github.com/city96/ComfyUI-GGUF git clone https://github.com/coreyryanhanson/ComfyQR git clone https://github.com/crystian/comfyui-crystools git clone https://github.com/cubiq/ComfyUI_essentials git clone https://github.com/cubiq/ComfyUI_InstantID git clone https://github.com/cubiq/ComfyUI_IPAdapter_plus git clone https://github.com/cubiq/PuLID_ComfyUI git clone https://github.com/CY-CHENYUE/ComfyUI-Janus-Pro git clone https://github.com/CY-CHENYUE/ComfyUI-Redux-Prompt git clone https://github.com/da2el-ai/D2-SavePSD-ComfyUI git clone https://github.com/djbielejeski/a-person-mask-generator git clone https://github.com/Dontdrunk/ComfyUI-DD-Translation git clone https://github.com/dorpxam/ComfyUI-LTXVideoLoRA git clone https://github.com/EllangoK/ComfyUI-post-processing-nodes git clone https://github.com/evanspearman/ComfyMath git clone https://github.com/EvilBT/ComfyUI_SLK_joy_caption_two git clone https://github.com/Extraltodeus/Skimmed_CFG git clone https://github.com/fairy-root/ComfyUI-OpenAI-FM git clone https://github.com/fairy-root/Flux-Prompt-Generator git clone https://github.com/Fannovel16/comfyui_controlnet_aux git clone https://github.com/Fannovel16/ComfyUI-Frame-Interpolation git clone https://github.com/Fannovel16/ComfyUI-Video-Matting git clone https://github.com/FizzleDorf/ComfyUI_FizzNodes git clone https://github.com/Flow-two/ComfyUI-WanStartEndFramesNative git clone https://github.com/fpgaminer/joycaption_comfyui git clone https://github.com/FunnyFinger/ComfyUi-RadarWeightNode git clone https://github.com/glifxyz/ComfyUI-GlifNodes git clone https://github.com/Goktug/ComfyUi_NNLatentUpscale git clone https://github.com/Goktug/comfyui-saveimage-plus git clone https://github.com/Gourieff/ComfyUI-ReActor git clone https://github.com/GrailGreg/images_base64 git clone https://github.com/huchenlei/ComfyUI-IC-Light-Native git clone https://github.com/huchenlei/ComfyUI-layerdiffuse git clone https://github.com/huchenlei/ComfyUI-openpose-editor git clone https://github.com/jags111/efficiency-nodes-comfyui git clone https://github.com/jamesWalker55/comfyui-various git clone https://github.com/jax-explorer/ComfyUI-VideoBasic git clone https://github.com/john-mnz/ComfyUI-Inspyrenet-Rembg git clone https://github.com/Jonseed/ComfyUI-Detail-Daemon git clone https://github.com/kaibioinfo/ComfyUI_AdvancedRefluxControl git clone https://github.com/kijai/ComfyUI-DepthAnythingV2 git clone https://github.com/kijai/ComfyUI-Florence2 git clone https://github.com/kijai/ComfyUI-GIMM-VFI git clone https://github.com/kijai/ComfyUI-HunyuanVideoWrapper git clone https://github.com/kijai/ComfyUI-IC-Light git clone https://github.com/kijai/ComfyUI-KJNodes git clone https://github.com/kijai/ComfyUI-Marigold git clone https://github.com/kijai/ComfyUI-WanVideoWrapper git clone https://github.com/Kosinkadink/ComfyUI-Advanced-ControlNet git clone https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite git clone https://github.com/LAOGOU-666/Comfyui_LG_Tools git clone https://github.com/Layer-norm/comfyui-lama-remover git clone https://github.com/Lightricks/ComfyUI-LTXVideo git clone https://github.com/lldacing/ComfyUI_Patches_ll git clone https://github.com/lldacing/ComfyUI_PuLID_Flux_ll git clone https://github.com/Loewen-Hob/rembg-comfyui-node-better git clone https://github.com/lquesada/ComfyUI-Inpaint-CropAndStitch git clone https://github.com/lrzjason/Comfyui-In-Context-Lora-Utils git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack git clone https://github.com/ltdrdata/ComfyUI-Impact-Subpack git clone https://github.com/ltdrdata/ComfyUI-Inspire-Pack git clone https://github.com/ltdrdata/ComfyUI-Manager git clone https://github.com/ltdrdata/was-node-suite-comfyui git clone https://github.com/M1kep/ComfyLiterals git clone https://github.com/melMass/comfy_mtb git clone https://github.com/melMass/comfy_mtb git clone https://github.com/mingsky-ai/ComfyUI-MingNodes git clone https://github.com/neverbiasu/ComfyUI-SAM2 git clone https://github.com/nullquant/ComfyUI-BrushNet git clone https://github.com/orssorbit/ComfyUI-wanBlockswap git clone https://github.com/PressWagon/ComfyUI-StringsAndThings git clone https://github.com/pythongosssss/ComfyUI-Custom-Scripts git clone https://github.com/pythongosssss/ComfyUI-WD14-Tagger git clone https://github.com/raindrop313/ComfyUI-WanVideoStartEndFrames git clone https://github.com/shadowcz007/comfyui-mixlab-nodes git clone https://github.com/Shakker-Labs/ComfyUI-IPAdapter-Flux git clone https://github.com/sipherxyz/comfyui-art-venture git clone https://github.com/smthemex/ComfyUI_Pops git clone https://github.com/smthemex/ComfyUI_Sonic git clone https://github.com/smthemex/ComfyUI_YuE git clone https://github.com/ssitu/ComfyUI_UltimateSDUpscale git clone https://github.com/Stability-AI/stability-ComfyUI-nodes git clone https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes git clone https://github.com/talesofai/comfyui-browser git clone https://github.com/TFL-TFL/ComfyUI_Text_Translation git clone https://github.com/TheMistoAI/ComfyUI-Anyline git clone https://github.com/Tropfchen/ComfyUI-Embedding_Picker git clone https://github.com/TTPlanetPig/Comfyui_TTP_Toolset git clone https://github.com/un-seen/comfyui-tensorops git clone https://github.com/VAST-AI-Research/ComfyUI-Tripo git clone https://github.com/WaveSpeedAI/wavespeed-comfyui git clone https://github.com/welltop-cn/ComfyUI-TeaCache git clone https://github.com/xhiroga/ComfyUI-FramePackWrapper_PlusOne git clone https://github.com/XLabs-AI/x-flux-comfyui git clone https://github.com/yolain/ComfyUI-Easy-Use # 批量安装插件依赖 find /workspace/custom_nodes -name requirements.txt -exec pip install -r {} \; # 重新安装ComfyUI依赖 pip install -r /workspace/comfyui/requirements.txt # 链接插件目录到ComfyUI目录 rm -r /workspace/comfyui/custom_nodes ln -s /workspace/custom_nodes /workspace/comfyui/ # 启动ComfyUI看看还缺什么依赖或哪些依赖存在冲突,手工处理一下!!! /workspace/venv/bin/python /workspace/comfyui/main.py --listen --auto-launch
其他插件:
# 启动较慢插件 git clone https://github.com/billwuhao/ComfyUI_PortraitTools # UI类插件 git clone https://github.com/rgthree/rgthree-comfy # 会生成独立按钮的插件 git clone https://github.com/ainewsto/Comfyui_Comfly git clone https://github.com/bytedance/comfyui-lumi-batcher # python3.12暂不支持的插件 git clone https://github.com/kijai/ComfyUI-SUPIR git clone https://github.com/chflame163/ComfyUI_WordCloud git clone https://github.com/ZHO-ZHO-ZHO/ComfyUI-YoloWorld-EfficientSAM git clone https://github.com/filliptm/ComfyUI_Fill-Nodes git clone https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet # 部分支持
为了实现自动下载模型,首先需要手工收集模型的下载链接,并保存到一个文件里。这里还需要指定模型的下载路径,建议使用json格式。
注意:
checkpoints、clip、clip_vision、controlnet、diffusion_models、loras、text_encoders、upscale_models、vae文件夹是由ComfyUI底层函数搜索的,可以通过hook源码实现自动下载。
对于插件来说,得具体看插件是如何查找相关模型的,如果是调用ComfyUI底层函数,那该方法同样有效,否则无效。
示例:
{ "checkpoints": { "hunyuan_dit_1.0.safetensors": "https://cnb.cool/ai-models/comfyanonymous/hunyuan_dit_comfyui/-/lfs/60ee5b765b40575c23a82cb4fec8e51e28157391e94397abf40d9546e81e1c58", "hunyuan_dit_1.1.safetensors": "https://cnb.cool/ai-models/comfyanonymous/hunyuan_dit_comfyui/-/lfs/26ab130e7bb515e976aa6d8fac8c3f11caef986c13140447ba102a4b1e675245", "hunyuan_dit_1.2.safetensors": "https://cnb.cool/ai-models/comfyanonymous/hunyuan_dit_comfyui/-/lfs/4fb84f84079cda457d171b3c6b15d1be95b5a3e5d9825703951a99ddf92d1787" }, "clip_vision": { "clip_vision_g.safetensors": "https://cnb.cool/ai-models/comfyanonymous/clip_vision_g/-/lfs/9908329b3ead722a693ea400fab1d7c9ec91d6736fd194a94d20d793457f9c2e" } }
注意:这里主要是介绍修改思路/原理,本仓库中的实际代码可能有所不同,是针对实际情况优化修改的(如模型选项去重等,这里不再介绍)。
原始代码函数定位:
def recursive_search(directory: str, excluded_dir_names: list[str] | None=None) -> tuple[list[str], dict[str, float]]: if not os.path.isdir(directory): return [], {} if excluded_dir_names is None: excluded_dir_names = [] result = [] dirs = {} # Attempt to add the initial directory to dirs with error handling try: dirs[directory] = os.path.getmtime(directory) except FileNotFoundError: logging.warning(f"Warning: Unable to access {directory}. Skipping this path.") logging.debug("recursive file list on directory {}".format(directory)) dirpath: str subdirs: list[str] filenames: list[str] for dirpath, subdirs, filenames in os.walk(directory, followlinks=True, topdown=True): subdirs[:] = [d for d in subdirs if d not in excluded_dir_names] for file_name in filenames: try: relative_path = os.path.relpath(os.path.join(dirpath, file_name), directory) result.append(relative_path) except: logging.warning(f"Warning: Unable to access {file_name}. Skipping this file.") continue for d in subdirs: path: str = os.path.join(dirpath, d) try: dirs[path] = os.path.getmtime(path) except FileNotFoundError: logging.warning(f"Warning: Unable to access {path}. Skipping this path.") continue logging.debug("found {} files".format(len(result))) return result, dirs
修改为:
# 导入json模块用来加载模型下载链接文件,导入subprocess模块用于后续调用aria2c下载模型 import json, subprocess # 假设存放模型下载链接的文件是/workspace/source.json source_file = "/workspace/source.json" all_file_dict = {} if os.path.exists(source_file): with open(source_file, "r", encoding="utf-8") as file: all_file_dict = json.load(file) def recursive_search(directory: str, excluded_dir_names: list[str] | None=None) -> tuple[list[str], dict[str, float]]: if not os.path.isdir(directory): return [], {} if excluded_dir_names is None: excluded_dir_names = [] result = [] dirs = {} # Attempt to add the initial directory to dirs with error handling try: dirs[directory] = os.path.getmtime(directory) except FileNotFoundError: logging.warning(f"Warning: Unable to access {directory}. Skipping this path.") logging.debug("recursive file list on directory {}".format(directory)) dirpath: str subdirs: list[str] filenames: list[str] for dirpath, subdirs, filenames in os.walk(directory, followlinks=True, topdown=True): subdirs[:] = [d for d in subdirs if d not in excluded_dir_names] for file_name in filenames: try: relative_path = os.path.relpath(os.path.join(dirpath, file_name), directory) result.append(relative_path) except: logging.warning(f"Warning: Unable to access {file_name}. Skipping this file.") continue for d in subdirs: path: str = os.path.join(dirpath, d) try: dirs[path] = os.path.getmtime(path) except FileNotFoundError: logging.warning(f"Warning: Unable to access {path}. Skipping this path.") continue # 将all_file_dict中的模型添加到节点选项中,这里注意models文件夹的实际绝对位置 if "/workspace/comfyui/models/" in directory: folder = directory.split("/workspace/comfyui/models/")[-1] if folder in all_file_dict: for file in all_file_dict[folder]: # 跳过已经存在的文件选项 if file not in result: result.append(file) logging.debug("found {} files".format(len(result))) return result, dirs
原始代码函数定位:
def get_full_path_or_raise(folder_name: str, filename: str) -> str: """ Get the full path of a file in a folder, has to be a file """ full_path = get_full_path(folder_name, filename) if full_path is None: raise FileNotFoundError(f"Model in folder '{folder_name}' with filename '{filename}' not found.") return full_path
修改为:
def get_full_path_or_raise(folder_name: str, filename: str) -> str: """ Get the full path of a file in a folder, has to be a file """ full_path = get_full_path(folder_name, filename) # 当没有找到模型时,尝试下载,注意models_path的位置,本仓库的.cnb.yml中将/models挂载在云节点缓存里 if full_path is None: models_path = "/models" url = "" if folder_name in all_file_dict: file_dict = all_file_dict[folder_name] if filename in file_dict: url = file_dict[filename] file_path = os.path.join(models_path, folder_name, filename) folder_path = os.path.dirname(file_path) file_name = os.path.basename(file_path) os.makedirs(folder_path, exist_ok=True) subprocess.run(f'aria2c -x 4 -s 4 -c -d "{folder_path}" -o "{file_name}" "{url}"', shell=True) if os.path.isfile(file_path): full_path = file_path if full_path is None: raise FileNotFoundError(f"Model in folder '{folder_name}' with filename '{filename}' not found.") return full_path
将预设模型添加到UI界面选项中,主要是避免UI界面弹出模型缺失的提示
原始代码函数定位:
def recursive_search_models_(self, directory: str, pathIndex: int) -> tuple[list[str], dict[str, float], float]: if not os.path.isdir(directory): return [], {}, time.perf_counter() excluded_dir_names = [".git"] # TODO use settings include_hidden_files = False result: list[str] = [] dirs: dict[str, float] = {} for dirpath, subdirs, filenames in os.walk(directory, followlinks=True, topdown=True): subdirs[:] = [d for d in subdirs if d not in excluded_dir_names] if not include_hidden_files: subdirs[:] = [d for d in subdirs if not d.startswith(".")] filenames = [f for f in filenames if not f.startswith(".")] filenames = filter_files_extensions(filenames, folder_paths.supported_pt_extensions) for file_name in filenames: try: full_path = os.path.join(dirpath, file_name) relative_path = os.path.relpath(full_path, directory) # Get file metadata file_info = { "name": relative_path, "pathIndex": pathIndex, "modified": os.path.getmtime(full_path), # Add modification time "created": os.path.getctime(full_path), # Add creation time "size": os.path.getsize(full_path) # Add file size } result.append(file_info) except Exception as e: logging.warning(f"Warning: Unable to access {file_name}. Error: {e}. Skipping this file.") continue for d in subdirs: path: str = os.path.join(dirpath, d) try: dirs[path] = os.path.getmtime(path) except FileNotFoundError: logging.warning(f"Warning: Unable to access {path}. Skipping this path.") continue return result, dirs, time.perf_counter()
修改为:
def recursive_search_models_(self, directory: str, pathIndex: int) -> tuple[list[str], dict[str, float], float]: if not os.path.isdir(directory): return [], {}, time.perf_counter() excluded_dir_names = [".git"] # TODO use settings include_hidden_files = False result: list[str] = [] dirs: dict[str, float] = {} for dirpath, subdirs, filenames in os.walk(directory, followlinks=True, topdown=True): subdirs[:] = [d for d in subdirs if d not in excluded_dir_names] if not include_hidden_files: subdirs[:] = [d for d in subdirs if not d.startswith(".")] filenames = [f for f in filenames if not f.startswith(".")] filenames = filter_files_extensions(filenames, folder_paths.supported_pt_extensions) for file_name in filenames: try: full_path = os.path.join(dirpath, file_name) relative_path = os.path.relpath(full_path, directory) # Get file metadata file_info = { "name": relative_path, "pathIndex": pathIndex, "modified": os.path.getmtime(full_path), # Add modification time "created": os.path.getctime(full_path), # Add creation time "size": os.path.getsize(full_path) # Add file size } result.append(file_info) except Exception as e: logging.warning(f"Warning: Unable to access {file_name}. Error: {e}. Skipping this file.") continue for d in subdirs: path: str = os.path.join(dirpath, d) try: dirs[path] = os.path.getmtime(path) except FileNotFoundError: logging.warning(f"Warning: Unable to access {path}. Skipping this path.") continue # 添加预设模型,这里同样注意models文件夹的实际绝对路径 if "/workspace/comfyui/models/" in directory: folder = directory.split("/workspace/comfyui/models/")[-1] # 从folder_paths.py中导入all_file_dict from folder_paths import all_file_dict if folder in all_file_dict: for file in all_file_dict[folder]: found = False for file_info in result: if file == file_info["name"]: found = True if not found: # 注意这里的file_info,实际上应包括pathIndex、modified、created、size四个参数,这里设置为0就可以避免弹出缺少模型的提示了 # 但都设置为0,在UI界面中,点击模型库模块里的模型,可能没有反应 file_info = { "name": file, "pathIndex": 0, "modified": 0, "created": 0, "size": 0 } result.append(file_info) return result, dirs, time.perf_counter()
该文件主要是添加额外的模型搜索路径,这里添加/models文件夹,是为了把自动下载的模型缓存在云节点上。需要搭配.cnb.yml文件设置。
comfyui: base_path: /models/ checkpoints: checkpoints/ clip: clip/ clip_vision: clip_vision/ configs: configs/ controlnet: controlnet/ diffusion_models: | diffusion_models unet embeddings: embeddings/ loras: loras/ upscale_models: upscale_models/ vae: vae/
通过volumes设置缓存文件夹/models
$: vscode: - docker: image: docker.cnb.cool/cnb-xu/docker/comfyui:latest volumes: - /models