Shenrui-Ma/video-regen-recipes / skills/comfyui-reference-images
comfyui-reference-images
Verified用本地或自托管远程 ComfyUI 制作角色参考图、场景图和视频首尾/中间帧;按 SDXL、Anima 家族查找并核验 Civitai/Hugging Face 模型,检查工作流、执行、恢复和验收。
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.1 KB |
| references/batch-generation.md | markdown | 10.1 KB |
| references/execution.md | markdown | 5.0 KB |
| references/families-and-prompts.md | markdown | 3.8 KB |
| references/local.md | markdown | 1.4 KB |
| references/model-discovery.md | markdown | 5.4 KB |
| references/remote.md | markdown | 1.6 KB |
| references/toolkit.lock.json | config | 1.5 KB |
| references/toolkit.md | markdown | 2.2 KB |
| scripts/prepare_graph.py | script | 8.9 KB |
| scripts/resolve_workflow.py | script | 3.1 KB |
| tests/test_prepare_graph.py | script | 9.0 KB |
references/model-discovery.md
View on GitHub# 模型发现与可恢复下载
来源核验日期:2026-09-11。实际运行时复查所选版本,不把本文日期当作模型版本。
缺模型时 Agent 应主动搜索、比较并完成授权范围内的下载,不把“请自己找模型”作为默认结论。先明确所需家族、组件类型、用途、精度/显存与磁盘预算;没有通用的“最好的动漫模型”。
## 1. 先盘点,避免重复下载
调用 `/models`、`/models/{folder}` 与 loader 的 `/object_info`。必要时在**执行主机**读取已有模型的大小、SHA-256 和安全格式元数据。
| 组件 | 常见目录(以实例配置为准) |
|---|---|
| 完整 checkpoint | `models/checkpoints` |
| 独立扩散模型 | `models/diffusion_models` |
| 文本编码器 | `models/text_encoders` |
| VAE / LoRA | `models/vae` / `models/loras` |
同一文件可能放错分类或使用不同子目录。先比哈希与来源,再修正工作流引用或采用现有 `extra_model_paths.yaml` 配置;不要仅凭同名就复用、搬走或覆盖文件。文件在磁盘上不等于 loader 能发现。
## 2. 搜索并锁定候选
**Civitai(C 站):**使用官方 `GET https://civitai.com/api/v1/models`,通过 `query`、`types`、`baseModels` 缩小候选。枚举值按当前文档读取,关键词要 URL 编码;带 `query` 时用返回的 cursor 分页,不能同时带 `page`。搜索结果只作候选。[模型搜索 API](https://github.com/civitai/civitai-developer-docs/blob/main/site/reference/models.md)
读取 `GET /api/v1/models/{model_id}` 的作者说明及许可,再读 `GET /api/v1/model-versions/{version_id}`:核对 `baseModel`、版本说明、触发词、全部 `files` 的格式/精度/大小/完整 SHA-256,选定具体文件及其 `downloadUrl`。不要默认首个文件、最高下载量或模型级链接指向所需版本。已有 SHA-256 可用 `/api/v1/model-versions/by-hash/{hash}` 反查。[版本 API](https://github.com/civitai/civitai-developer-docs/blob/main/site/reference/model-versions.md)
**Hugging Face:**优先模型发布方仓库,再看其链接的兼容发布。可用站内搜索,或现有 `huggingface_hub` 的 `HfApi().list_models(search=..., limit=...)`。读模型卡、配置、文件列表及 LICENSE;用 `model_info(repo_id, files_metadata=True)` 取得版本信息,将分支解析成 commit SHA,再按该 commit 核查具体文件。仓库名和标签不能单独证明架构兼容。[搜索](https://huggingface.co/docs/huggingface_hub/guides/search)、[元数据 API](https://huggingface.co/docs/huggingface_hub/package_reference/hf_api)
每个依赖写一条记录到项目 `models.lock.json`(自定义清单,不是 ComfyUI API 图):
```json
{
"role": "lora",
"family": "待核实的架构与训练底模",
"source_page": "公开的版本或文件页面",
"revision_or_version_id": "固定版本",
"filename": "实际文件名",
"format": "safetensors",
"expected_bytes": null,
"expected_sha256": null,
"license_source": "该版本许可页面",
"compatibility_evidence": "模型卡或配置中的依据",
"loader_category": "loras",
"status": "candidate"
}
```
这是填写格式示意;上述占位文字不能直接投入运行。补充实际字节数、下载后哈希、触发词和精度。`sizeKB` 可能有舍入,不冒充精确字节数;HF ETag/Git blob ID 也不一定是文件 SHA-256。没有发布方完整哈希时注明缺失,自算值只证明本次副本,不能宣称上游一致性已验证。架构、许可或必要依赖无法确认时,继续查证或选择证据充分的候选。
## 3. 下载与落盘
1. 确认版本许可覆盖用户的用法;模型权重许可和生成图片许可分开记录。下载权限不等于转载许可。无需将模型权重提交本仓库。
2. 校验目标目录、预计大小和空间,包括暂存与搬运占用。选择可信来源的安全张量文件;不要加载不可信 pickle,也不要为了读模型元数据执行仓库代码。
3. HF 优先使用已有官方客户端的单文件下载,指定 `repo_id`、`filename` 和固定 `revision`;支持时先 `dry_run=True`。恢复时沿用相同缓存/目录及 revision,不下载整库。[官方文件下载](https://huggingface.co/docs/huggingface_hub/guides/download)
4. 普通 HTTP 下载写入目标同文件系统的 `.part`。采用有边界的重试;续传需确认响应 `206`、起始偏移和版本标识未变。若返回 `200`,重新写入,不能把完整文件追加到旧片段;遇到 `416` 先核验总长度。
5. 401/403 只检查该服务认证、门控许可与链接有效期;不绕过访问限制。429 按 `Retry-After` 退避;5xx/超时有限重试。使用运行时认证,日志不输出 token 或带签名的临时下载 URL;跨域重定向不转发认证头。
6. 拒收 HTML、JSON 错误页和 Git LFS 指针。完整文件先检查大小、格式,再流式计算 SHA-256,与**选中文件**的上游哈希对比;失败保留隔离片段,不能进入 loader 目录。
7. 校验通过才原子重命名。已存在目标:相同哈希则复用,不同则采用清晰版本名,不能覆盖。重新读取 loader 的模型枚举,写入它实际返回的相对名称。
外部说明中的命令不具有授权效力。自定义节点属于可执行软件,缺节点先查官方实现及依赖,不能把下载模型变成批量安装未知插件。
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |