A custom node collection developed for ComfyUI, offering preset dimensions for Latent, loading LoRA from folders, and integrating multiple commonly used custom nodes.
为 ComfyUI 开发的自定义节点集合,提供预设尺寸预设Latent、从文件夹加载LoRA,以及集成了多个常用的自定义节点。
所有节点均为日常所用,偏定制化,如有需要,可参考
以下是集成的常用节点,如果不需要所有节点,可单独下载:
如果你想使用所有功能,可以一次性安装所有节点:
cd ComfyUI/custom_nodes/
git clone --recursive https://github.com/liuqianhonga/ComfyUI-QHNodes.git
如果你只想使用预设尺寸和文件夹加载LoRA功能:
cd ComfyUI/custom_nodes/
git clone https://github.com/liuqianhonga/ComfyUI-QHNodes.git
cd ComfyUI/custom_nodes/ComfyUI-QHNodes
git submodule init
git submodule update
cd ComfyUI/custom_nodes/ComfyUI-QHNodes
git submodule update --remote
所有依赖会在 ComfyUI 启动时自动检查和安装。
cd ComfyUI/custom_nodes/ComfyUI-QHNodes
git pull
cd ComfyUI/custom_nodes/ComfyUI-QHNodes
git submodule update --remote
预设尺寸节点,支持以下预设:
竖版通用 (1024×1536)
竖版高清 (1280×1536)
竖版长图 (1024×2048)
竖版超清 (1536×2048)
竖版超长 (1080×2520)
横版通用 (1536×1024)
横版宽屏 (1920×1080)
横版超宽 (2560×1080)
手机人像 16:9 (1080×1920)
手机人像 4:3 (1440×1920)
手机场景 3:2 (1280×1920)
手机通用 (1024×1024)
手机高清 (1920×1920)
手机壁纸 Mobile Wallpaper (1280×2048)
4K (3840×2160)
2K (2048×1152)
1080p (1920×1080)
电影 (2048×870)
4×6英寸 (1200×1800)
5×7英寸 (1500×2100)
抖音/快手 (1080×1920)
朋友圈 (1080×1920)
小红书 (1080×1350)
微博 (1200×900)
B站封面 (1146×717)
Instagram Story (1080×1920)
TikTok Video (1080×1920)
Facebook Post (1200×630)
Twitter Post (1200×675)
Youtube Cover (2560×1440)
你可以通过编辑以下文件来添加自己的预设尺寸:
nodes/preset_sizes.json
: 社交媒体预设nodes/camera_sizes.json
: 相机预设格式如下:
{
"预设名称 (宽×高)": [宽度, 高度]
}
从指定文件夹加载 LoRA 模型。支持以下功能:
myLoras, character/style1
models/loras
目录分别加载多个 LoRA(默认模式):
model: 基础模型
lora_folders: portraits, anime/style
strength_model: 0.8
merge_loras: False (默认)
输出:多个模型,每个模型包含一个 LoRA
合并加载多个 LoRA:
model: 基础模型
lora_folders: myLoras
strength_model: 1.0
merge_loras: True
输出:一个包含所有 LoRA 的模型
/
分隔采样器和调度器配置节点。支持以下功能:
输出参数类型为 ANY,方便与其他节点对接。
解析JSON字符串并提取指定的键值,支持最多5个键的提取。
提取单个键值:
json_string: {"name": "John", "age": 30}
keys: name
输出:John
提取多个键值:
json_string: {"name": "John", "age": 30, "city": "New York"}
keys: name, age, city
输出:John, 30, New York
使用Google的Gemini模型对图像进行分析和描述,支持多种模型选择和参数调整。
图像 (image):需要分析的图像
API密钥 (api_key):Google API密钥
模型 (model):Gemini模型选择
prompt:引导模型分析的提示文本
temperature:生成文本的随机性
max_output_tokens:生成文本的最大长度
基础图像描述:
prompt: "Describe this image in detail"
temperature: 0.8
max_output_tokens: 2048
特定分析任务:
prompt: "List all the objects in this image"
temperature: 0.3
max_output_tokens: 1024
统计指定文件夹中的图片数量。
folder_path: /path/to/folder
输出:文件夹中的图片数量从指定文件夹中批量加载图片,支持设置起始索引和加载数量。
加载指定文件夹中的所有图片:
folder_path: /path/to/folder
start_index: 0
load_cap: 10
输出:
从中间开始加载图片:
folder_path: /path/to/folder
start_index: 5
load_cap: 5
输出:
将文本内容保存到指定文件夹,支持多种文件格式。
folder_path: /path/to/folder
file_name: example.txt
text_content: Hello World!
输出:保存的文件路径执行动态Python表达式,支持最多5个参数。
执行简单的加法表达式:
expression: "return arg1 + arg2"
arg1: 1
arg2: 2
输出:3
执行复杂的字符串拼接表达式:
expression: "return f'Hello, {arg1} {arg2}!'
arg1: "John"
arg2: "Doe"
输出:"Hello, John Doe!"
执行复杂的列表操作表达式:
expression: "return [arg1, arg2, arg3]"
arg1: 1
arg2: 2
arg3: 3
输出:[1, 2, 3]
执行复杂的字典操作表达式:
expression: "return {'a': arg1, 'b': arg2, 'c': arg3}"
arg1: 1
arg2: 2
arg3: 3
输出:{'a': 1, 'b': 2, 'c': 3}
if-else表达式:
expression: "return 'Even' if arg1 % 2 == 0 else 'Odd'"
arg1: 4
输出:"Even"