siliconflow/Comfyui-HYPIR
forked from 11dogzi/Comfyui-HYPIR
Captured source
source ↗siliconflow/Comfyui-HYPIR
Stars: 0
Forks: 0
Open issues: 0
Created: 2026-01-07T09:26:05Z
Pushed: 2025-08-03T02:14:03Z
Default branch: main
Fork: yes
Parent repository: 11dogzi/Comfyui-HYPIR
Archived: no
README: 原项目地址https://github.com/XPixelGroup/HYPIR?tab=readme-ov-file
HYPIR ComfyUI Plugin
HYPIR ComfyUI 插件
This is a ComfyUI plugin for HYPIR (Harnessing Diffusion-Yielded Score Priors for Image Restoration), a state-of-the-art image restoration model based on Stable Diffusion 2.1. 这是一个用于 HYPIR(利用扩散得分先验进行图像修复) 的 ComfyUI 插件,HYPIR 是基于 Stable Diffusion 2.1 的先进图像修复模型。
Features
功能特性
- Image Restoration: Restore and enhance low-quality images using diffusion priors
- 图像修复:利用扩散先验修复和增强低质量图像
- Batch Processing: Process multiple images at once
- 批量处理:一次处理多张图片
- Advanced Controls: Fine-tune model parameters for optimal results
- 高级控制:可微调模型参数以获得最佳效果
- Model Management: Load and reuse HYPIR models efficiently
- 模型管理:高效加载和复用 HYPIR 模型
- Upscaling: Built-in upscaling capabilities (1x to 8x)
- 放大功能:内置放大功能(1x 到 8x)
Installation
安装方法
1. Install the Plugin
1. 安装插件
Place this folder in your ComfyUI custom_nodes directory: 将本文件夹放入 ComfyUI 的 custom_nodes 目录下:
ComfyUI/custom_nodes/Comfyui-HYPIR/
2. Install HYPIR Dependencies
2. 安装 HYPIR 依赖
Navigate to the HYPIR folder and install the required dependencies: 进入 HYPIR 文件夹并安装所需依赖:
cd ComfyUI/custom_nodes/Comfyui-HYPIR/HYPIR pip install -r requirements.txt
3. Model Download (Automatic)
3. 模型下载(自动)
The plugin will automatically download the required models on first use: 插件首次使用时会自动下载所需模型:
HYPIR Model
HYPIR 模型
The HYPIR restoration model will be downloaded to: HYPIR 修复模型将下载到:
ComfyUI/models/HYPIR/HYPIR_sd2.pth
Base Model (Stable Diffusion 2.1)
基础模型(Stable Diffusion 2.1)
The base Stable Diffusion 2.1 model will be automatically downloaded when needed to: 基础 Stable Diffusion 2.1 模型将在需要时自动下载到:
ComfyUI/models/HYPIR/stable-diffusion-2-1-base/
Manual Download (Optional): 手动下载(可选):
HYPIR Model: HYPIR 模型: If you prefer to download manually, you can get the HYPIR model from: 如果你希望手动下载,可以从以下地址获取 HYPIR 模型:
- HuggingFace: HYPIR_sd2.pth
- HuggingFace:HYPIR_sd2.pth
- OpenXLab: HYPIR_sd2.pth
- OpenXLab:HYPIR_sd2.pth
Place the HYPIR_sd2.pth file in: 请将 HYPIR_sd2.pth 文件放在以下任一位置:
- Plugin directory:
ComfyUI/custom_nodes/Comfyui-HYPIR/ - 插件目录:
ComfyUI/custom_nodes/Comfyui-HYPIR/ - ComfyUI models directory:
ComfyUI/models/checkpoints/ - ComfyUI 模型目录:
ComfyUI/models/checkpoints/ - Or let the plugin automatically manage it in
ComfyUI/models/HYPIR/ - 或让插件自动管理,放在
ComfyUI/models/HYPIR/
Base Model: 基础模型: The base Stable Diffusion 2.1 model can be downloaded manually from: 基础 Stable Diffusion 2.1 模型可从以下地址手动下载:
- HuggingFace: stable-diffusion-2-1-base
- HuggingFace:stable-diffusion-2-1-base
Place the base model in: 请将基础模型放在:
ComfyUI/models/HYPIR/stable-diffusion-2-1-base/
Note: The plugin will automatically check for the base model in the HYPIR directory first. If not found, it will automatically download it from HuggingFace. 注意: 插件会优先在 HYPIR 目录下查找基础模型,如未找到会自动从 HuggingFace 下载。
Usage
使用方法
Advanced Image Restoration
高级图像修复
1. Add the HYPIR Advanced Restoration node 1. 添加 HYPIR Advanced Restoration 节点 2. This node provides additional control over: 2. 此节点提供更多参数控制:
model_t: Model timestep (default: 200)model_t:模型步数(默认200)coeff_t: Coefficient timestep (default: 200)coeff_t:系数步数(默认200)lora_rank: LoRA rank (default: 256)lora_rank:LoRA 阶数(默认256)patch_size: Processing patch size (default: 512)patch_size:处理块大小(默认512)
Configuration
配置
You can modify the default settings in hypir_config.py: 你可以在 hypir_config.py 中修改默认设置:
HYPIR_CONFIG = {
"default_weight_path": "HYPIR_sd2.pth",
"default_base_model_path": "stable-diffusion-2-1-base",
"available_base_models": ["stable-diffusion-2-1-base"],
"model_t": 200,
"coeff_t": 200,
"lora_rank": 256,
# ... more settings
}Model Path Management
模型路径管理
The plugin includes intelligent model path management: 插件包含智能模型路径管理:
- HYPIR Model: Automatically downloaded to
ComfyUI/models/HYPIR/HYPIR_sd2.pth - HYPIR 模型:自动下载到
ComfyUI/models/HYPIR/HYPIR_sd2.pth - Base Model: Automatically downloaded to
ComfyUI/models/HYPIR/stable-diffusion-2-1-base/when needed - 基础模型:需要时自动下载到
ComfyUI/models/HYPIR/stable-diffusion-2-1-base/ - Local Priority: The plugin checks for local models first before downloading
- 本地优先:插件会优先查找本地模型
- Automatic Download: Only downloads when models are not found locally
- 自动下载:仅在本地未找到模型时才下载
Tips for Best Results
最佳效果小贴士
1. Prompts: Use descriptive prompts that match the image content 1. 提示词:使用与图片内容相符的描述性提示词
- For portraits: "high quality portrait, detailed face, sharp features"
- 人像:"high quality portrait, detailed face, sharp features"
- For landscapes: "high quality landscape, detailed scenery, sharp focus"
- 风景:"high quality landscape, detailed scenery, sharp focus"
- For general images: "high quality, detailed, sharp, clear"
- 通用:"high quality, detailed, sharp, clear"
2. Upscaling: 2. 放大:
- Use 1x for restoration without size change
- 1x 表示仅修复不放大
- Use 2x-4x for moderate upscaling
- 2x-4x 适合中等放大
- Use 8x for maximum upscaling (may be slower)
- 8x 为最大放大(速度较慢)
3. Parameters: 3. 参数:
- Higher
model_tvalues (200-500) for stronger restoration model_t越高(200-500)修复越强- Higher
coeff_tvalues (200-500) for more aggressive enhancement coeff_t越高(200-500)增强越明显- Higher
lora_rank(256-512) for better quality (uses more memory) lora_rank越高(256-512)质量越好(占用更多内存)
4. Memory Management: 4. 内存管理:
- Use smaller
patch_size(256-512) if you encounter memory issues - 如遇内存不足可用较小的
patch_size(256-512) - Process images in smaller batches
- 分批处理图片
- Use the Model Loader node to avoid repeated model loading
-…
Excerpt shown — open the source for the full document.
Notability
notability 2.0/10Routine fork of a repo