ComfyUI-FastTool
Alleviate VRAM pressure, improve K-sampling speed
Nodes (8)
Multi LoRA Stack ends the loader chain
title: ComfyUI-FastTool
ComfyUI-FastTool
Alleviate VRAM pressure, improve K-sampling speed. (The node's growth is not significant when the video memory is sufficient)
缓解显存压力,显著提升 K 采样速度。(显存充足时该节点增速不明显)
📖 Introduction | 简介
[EN] A professional model fusion and VRAM optimization toolkit for ComfyUI. ComfyUI-FastTool efficiently bakes LoRA into base models with customizable precision (BF16 / FP16 / FP32). By offloading CLIP weights to system memory (CPU/NPU), it drastically reduces VRAM overhead and accelerates K-sampling speed. It is a highly recommended tool for users dealing with VRAM bottlenecks (e.g., 8GB/12GB GPUs).
[CN] 一款专业的 ComfyUI 模型融合与显存优化工具箱。ComfyUI-FastTool 能够将 LoRA 彻底物理烧录到底模中(支持 BF16 / FP16 / FP32 精度自定义),并支持将 CLIP 权重移出显存至系统内存,从而大幅释放显存占用,显著提升 K 采样性能。对于受限于显存容量(如 8G/12G 显卡)的用户来说,这是必备的优化神器。
[Updates/更新]
Anima Model Burner has been added. The node name is Anima模型烧录器.
Reduce VRAM usage when Anima is added to Lora
The usage is exactly the same as that of the [SDXL] Model Mixer.
加入了Anima模型烧录器,节点名字为Anima模型烧录器.
降低Anima加入lora时的显存占用
使用方法和【SDXL】Model Mixer完全一致
✨ Included Nodes | 包含节点
This toolkit provides three core nodes, matching exactly what you see in the ComfyUI search menu: 本工具箱提供三个核心节点,名称与你在 ComfyUI 中搜索到的完全一致:
-
🛠️
【SDXL】 Model Mixer(Class:TrueModelMixerDictFuser) -
[EN] Base model loader. Fuses and bakes LoRA weights directly into the UNET with high precision. Prevents runtime calculation overhead during sampling.
-
[CN] 底模加载与混合节点。将 LoRA 权重高精度直接烧录到 UNET 底模中,避免采样时的实时计算开销。
-
📋
【SDXL】多 LoRA 堆叠器(Class:MultiLoRAStack) -
[EN] LoRA stack node. Easily manage, adjust, and stack multiple LoRAs before physical baking.
-
[CN] 多 LoRA 堆叠节点。便捷地管理、调整和堆叠多个 LoRA,为物理烧录做准备。
-
🔄
🔄 VRAM CLIP Offloader(CLIP 搬到 CPU/NPU)(Class:VRAM_CLIP_Offloader) -
[EN] CLIP transfer node. Intercepts the CLIP model and forces it into system RAM, freeing up precious VRAM for the K-Sampler.
-
[CN] CLIP 转移节点。拦截 CLIP 模型并强制将其卸载至系统内存(CPU/NPU),为 K 采样器腾出宝贵的显卡显存空间。
📌 How to use the CLIP Offloader | CLIP 转移节点使用指南
⚠️ CRITICAL / 极度重要:
To ensure proper VRAM optimization without breaking prompt encoding, the 🔄 VRAM CLIP Offloader must be placed AFTER all model/LoRA loading, but BEFORE the CLIP Text Encode (Prompt) nodes.
为了确保显存优化生效且不破坏提示词编码,🔄 VRAM CLIP Offloader 必须放置在所有底模/LoRA 加载之后,并且在 CLIP 文本编码节点之前。
🧩 Workflow Placement / 连线示意图
[【SDXL】多 LoRA 堆叠器] (定义 LoRA 列表与权重)
│
│ (lora_stack)
▼
[【SDXL】Model Mixer] (加载基础模型并输出已注入 LoRA 的 CLIP)
│
│ (CLIP 输出)
▼
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ┃
┃ 🔄 VRAM CLIP Offloader(CLIP 搬到 CPU/NPU) ┃
┃ ┃
┃ <--- MUST BE PLACED HERE! (必须接在这里!) 【显存充足时可以不用,这个会降低速度】 ┃
┃ ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
│
│ (Offloaded CLIP)
▼
[CLIP Text Encode (Prompt) / CLIP 文本编码器]
│
│ (CONDITIONING)
▼
[K Sampler / K 采样器] (开始采样生成)
⚙️ Installation | 安装方法
Method 1: ComfyUI Manager (Recommended) | 方法 1:通过 ComfyUI Manager(推荐)
- Open the ComfyUI Manager interface. (打开 ComfyUI Manager 界面)
- Search for
FastToolorVRAM CLIP Offloader. (搜索FastTool或节点名称) - Click "Install" and restart ComfyUI. (点击安装,完成后重启 ComfyUI)
Method 2: Manual Git Clone | 方法 2:手动 Git 克隆
Navigate to your ComfyUI custom_nodes folder and run:
前往你的 ComfyUI custom_nodes 文件夹,运行以下命令:
cd custom_nodes
git clone https://github.com/Fengxiaoxiao-001/ComfyUI-FastTool.git
Restart ComfyUI. (重启 ComfyUI)
Anima Adapter 插件使用指南 | Anima Adapter Plugin User Guide
简介 | Introduction
这个ComfyUI插件为Anima DiT系列模型提供了轻量级的Adapter支持,允许你在不修改基础模型权重的情况下,快速添加风格、主题、细节增强等效果。插件还包含一个强大的模型烧录器,可以将LoRA和Adapter效果永久烧录到模型中,方便分享和使用。
This ComfyUI plugin provides lightweight Adapter support for the Anima DiT series of models, allowing you to quickly add styles, themes, detail enhancements, and other effects without modifying the base model weights. The plugin also includes a powerful model burner that can permanently bake LoRA and Adapter effects into the model for easy sharing and use.
安装指南 | Installation Guide
-
将本插件文件夹放入ComfyUI的
custom_nodes目录中 -
重启ComfyUI服务
-
将下载的Anima Adapter文件放入
models/anima_adapters目录中 -
刷新ComfyUI网页界面
-
Place this plugin folder into the
custom_nodesdirectory of ComfyUI -
Restart the ComfyUI service
-
Place downloaded Anima Adapter files into the
models/anima_adaptersdirectory -
Refresh the ComfyUI web interface
节点详细说明 | Node Detailed Description
1. Anima Adapter 插件堆 | Anima Adapter Stack
功能描述 | Function Description
用于堆叠多个Anima Adapter插件,支持最多4个Adapter同时生效,也可以与之前的Adapter堆进行叠加。
Used to stack multiple Anima Adapter plugins, supporting up to 4 Adapters to take effect simultaneously, and can also be stacked with previous Adapter stacks.
输入参数 | Input Parameters | 参数名 | Parameter Name | 类型 | Type | 默认值 | Default Value | 取值范围 | Value Range | 说明 | Description | |--------|----------------|------|------|--------|---------------|----------|-------------|------|-------------| | adapter_1 | adapter_1 | 下拉菜单 | Dropdown | None | 所有可用的Adapter文件 | All available Adapter files | 第一个要应用的Adapter | The first Adapter to apply | | strength_1 | strength_1 | 浮点数 | Float | 1.0 | -5.0 ~ 5.0 | 第一个Adapter的强度,负值表示反向效果 | Strength of the first Adapter, negative values indicate reverse effect | | adapter_2 | adapter_2 | 下拉菜单 | Dropdown | None | 所有可用的Adapter文件 | All available Adapter files | 第二个要应用的Adapter | The second Adapter to apply | | strength_2 | strength_2 | 浮点数 | Float | 1.0 | -5.0 ~ 5.0 | 第二个Adapter的强度 | Strength of the second Adapter | | adapter_3 | adapter_3 | 下拉菜单 | Dropdown | None | 所有可用的Adapter文件 | All available Adapter files | 第三个要应用的Adapter | The third Adapter to apply | | strength_3 | strength_3 | 浮点数 | Float | 1.0 | -5.0 ~ 5.0 | 第三个Adapter的强度 | Strength of the third Adapter | | adapter_4 | adapter_4 | 下拉菜单 | Dropdown | None | 所有可用的Adapter文件 | All available Adapter files | 第四个要应用的Adapter | The fourth Adapter to apply | | strength_4 | strength_4 | 浮点数 | Float | 1.0 | -5.0 ~ 5.0 | 第四个Adapter的强度 | Strength of the fourth Adapter | | prev_stack | prev_stack | ANIMA_ADAPTER_STACK | ANIMA_ADAPTER_STACK | None | 之前的Adapter堆 | Previous Adapter stack | 可选,与当前选择的Adapter叠加 | Optional, stacked with currently selected Adapters |
输出 | Output
anima_adapter_stack: 组合后的Adapter堆,可以传递给其他节点使用anima_adapter_stack: Combined Adapter stack that can be passed to other nodes for use
使用注意事项 | Usage Notes
-
Adapter的应用顺序是从下到上(prev_stack先应用,然后是adapter_1到adapter_4)
-
强度为0或选择"None"的Adapter会被自动忽略
-
多个Adapter叠加时,效果会相互影响,建议从低强度开始尝试
-
Adapters are applied from bottom to top (prev_stack first, then adapter_1 to adapter_4)
-
Adapters with strength 0 or selected as "None" are automatically ignored
-
When multiple Adapters are stacked, effects will interact with each other. It is recommended to start with low strength
2. Anima 设备修复器 | Anima Device Fix
功能描述 | Function Description
修复Anima模型中llm_adapter设备不匹配的问题,确保模型在正确的设备上运行,避免出现"tensor on different devices"错误。
Fixes the device mismatch issue of the llm_adapter in Anima models, ensuring the model runs on the correct device and avoiding "tensor on different devices" errors.
输入参数 | Input Parameters | 参数名 | Parameter Name | 类型 | Type | 默认值 | Default Value | 取值范围 | Value Range | 说明 | Description | |--------|----------------|------|------|--------|---------------|----------|-------------|------|-------------| | model | model | MODEL | MODEL | - | 加载的Anima模型 | Loaded Anima model | 需要修复设备的Anima模型 | Anima model that needs device fixing | | device | device | 下拉菜单 | Dropdown | auto | auto, cpu, cuda, npu | 目标运行设备 | Target running device | | dtype | dtype | 下拉菜单 | Dropdown | auto | auto, from_file, float16, bfloat16, float32 | 目标数据类型 | Target data type |
输出 | Output
MODEL: 修复后的Anima模型MODEL: Fixed Anima model
使用注意事项 | Usage Notes
-
建议在加载Anima模型后立即使用此节点
-
"auto"选项会自动选择最佳设备和数据类型
-
如果遇到CUDA内存不足,可以尝试将device设置为"cpu"
-
It is recommended to use this node immediately after loading the Anima model
-
The "auto" option automatically selects the best device and data type
-
If you encounter CUDA out of memory, try setting device to "cpu"
3. Anima Style Embeds From CLIP Vision
功能描述 | Function Description
从CLIP Vision的输出中提取风格嵌入向量,用于支持风格参考的Anima Adapter。
Extracts style embedding vectors from CLIP Vision output for use with style-reference Anima Adapters.
输入参数 | Input Parameters | 参数名 | Parameter Name | 类型 | Type | 默认值 | Default Value | 取值范围 | Value Range | 说明 | Description | |--------|----------------|------|------|--------|---------------|----------|-------------|------|-------------| | clip_vision_output | clip_vision_output | CLIP_VISION_OUTPUT | CLIP_VISION_OUTPUT | - | CLIP Vision节点的输出 | Output from CLIP Vision node | 包含参考图像特征的CLIP Vision输出 | CLIP Vision output containing reference image features | | target_dim | target_dim | 整数 | Integer | 768 | 1 ~ 4096 | 目标嵌入维度,需要与Adapter要求的维度匹配 | Target embedding dimension, needs to match the dimension required by the Adapter | | normalize | normalize | 布尔值 | Boolean | False | True/False | 是否对嵌入向量进行归一化 | Whether to normalize the embedding vector |
输出 | Output
style_embeds: 提取的风格嵌入向量,可以传递给模型烧录器style_embeds: Extracted style embedding vector that can be passed to the model burner
使用注意事项 | Usage Notes
-
大多数Anima风格Adapter使用768维的嵌入向量
-
建议使用与Anima模型配套的CLIP Vision模型
-
参考图像的质量和内容会直接影响风格迁移效果
-
Most Anima style Adapters use 768-dimensional embedding vectors
-
It is recommended to use the CLIP Vision model that matches the Anima model
-
The quality and content of the reference image will directly affect the style transfer effect
4. Anima模型烧录器 | Anima Model Burner (SeparateModelMixerDictFuser)
功能描述 | Function Description
将基础模型、VAE、CLIP、LoRA和Anima Adapter合并为一个完整的模型,永久烧录所有效果,生成可以直接使用的单文件模型。
Merges the base model, VAE, CLIP, LoRA, and Anima Adapter into a complete model, permanently baking all effects to generate a single-file model that can be used directly.
输入参数 | Input Parameters | 参数名 | Parameter Name | 类型 | Type | 默认值 | Default Value | 取值范围 | Value Range | 说明 | Description | |--------|----------------|------|------|--------|---------------|----------|-------------|------|-------------| | model | model | 下拉菜单 | Dropdown | - | 所有可用的Anima基础模型 | All available Anima base models | Anima基础模型文件 | Anima base model file | | clip | clip | 下拉菜单 | Dropdown | - | 所有可用的CLIP模型 | All available CLIP models | Anima配套的Qwen3 CLIP模型 | Qwen3 CLIP model for Anima | | vae | vae | 下拉菜单 | Dropdown | - | 所有可用的VAE模型 | All available VAE models | Anima配套的VAE模型 | VAE model for Anima | | lora_stack | lora_stack | LORA_STACK | LORA_STACK | None | LoRA堆节点的输出 | Output from LoRA stack node | 可选,要烧录的LoRA效果 | Optional, LoRA effects to bake | | anima_adapter_stack | anima_adapter_stack | ANIMA_ADAPTER_STACK | ANIMA_ADAPTER_STACK | None | Anima Adapter堆节点的输出 | Output from Anima Adapter stack node | 可选,要烧录的Adapter效果 | Optional, Adapter effects to bake | | style_embeds | style_embeds | ANIMA_STYLE_EMBEDS | ANIMA_STYLE_EMBEDS | None | 风格嵌入节点的输出 | Output from style embedding node | 可选,风格参考嵌入向量 | Optional, style reference embedding vector | | save_dtype | save_dtype | 下拉菜单 | Dropdown | auto | auto, float16, bfloat16, float32 | 烧录后模型的保存数据类型 | Data type for the baked model | | device | device | 下拉菜单 | Dropdown | auto | auto, cpu, cuda, npu | 烧录过程使用的设备 | Device used for the baking process | | adapter_device | adapter_device | 下拉菜单 | Dropdown | auto | auto, cpu, cuda, npu | Adapter运行使用的设备 | Device used for Adapter execution | | adapter_dtype | adapter_dtype | 下拉菜单 | Dropdown | auto | auto, from_file, float16, bfloat16, float32 | Adapter运行使用的数据类型 | Data type used for Adapter execution | | adapter_num_blocks | adapter_num_blocks | 整数 | Integer | 28 | 1 ~ 128 | Anima DiT的块数量,通常为28 | Number of blocks in Anima DiT, usually 28 |
输出 | Output
MODEL: 烧录后的完整模型CLIP: 烧录后的CLIP模型VAE: 烧录后的VAE模型MODEL: Complete baked modelCLIP: Baked CLIP modelVAE: Baked VAE model
使用注意事项 | Usage Notes
-
烧录过程会消耗大量显存,建议使用CUDA设备
-
"auto"选项会自动选择最佳的设备和数据类型
-
烧录后的模型可以直接保存为safetensors文件,无需再次加载LoRA和Adapter
-
如果烧录过程中出现显存不足,可以尝试将device设置为"cpu",但速度会变慢
-
The baking process consumes a lot of VRAM, it is recommended to use a CUDA device
-
The "auto" option automatically selects the best device and data type
-
The baked model can be directly saved as a safetensors file without loading LoRA and Adapter again
-
If you encounter out of memory during baking, try setting device to "cpu", but it will be slower
快速开始指南 | Quick Start Guide
基本使用流程 | Basic Usage Flow
-
加载Anima基础模型
-
使用
Anima Adapter 插件堆节点选择要应用的Adapter -
将Adapter堆连接到
Anima模型烧录器的anima_adapter_stack输入 -
选择对应的CLIP和VAE模型
-
运行工作流,生成烧录后的模型
-
使用烧录后的模型进行图像生成
-
Load the Anima base model
-
Use the
Anima Adapter Stacknode to select the Adapter to apply -
Connect the Adapter stack to the
anima_adapter_stackinput of theAnima Model Burner -
Select the corresponding CLIP and VAE models
-
Run the workflow to generate the baked model
-
Use the baked model for image generation
风格参考工作流 | Style Reference Workflow
-
使用
CLIP Vision Loader节点加载CLIP Vision模型 -
使用
Load Image节点加载参考风格图像 -
将图像连接到
CLIP Vision Encode节点 -
将CLIP Vision输出连接到
Anima Style Embeds From CLIP Vision节点 -
将生成的style_embeds连接到
Anima模型烧录器的style_embeds输入 -
选择支持风格参考的Adapter并烧录模型
-
Use the
CLIP Vision Loadernode to load the CLIP Vision model -
Use the
Load Imagenode to load the reference style image -
Connect the image to the
CLIP Vision Encodenode -
Connect the CLIP Vision output to the
Anima Style Embeds From CLIP Visionnode -
Connect the generated style_embeds to the
style_embedsinput of theAnima Model Burner -
Select a style-reference compatible Adapter and bake the model
多效果叠加工作流 | Multi-Effect Stacking Workflow
-
创建多个
Anima Adapter 插件堆节点 -
将第一个Adapter堆的输出连接到第二个Adapter堆的
prev_stack输入 -
以此类推,最多可以叠加任意数量的Adapter
-
将最终的Adapter堆连接到模型烧录器
-
同时可以添加LoRA堆,实现LoRA+Adapter的混合效果
-
Create multiple
Anima Adapter Stacknodes -
Connect the output of the first Adapter stack to the
prev_stackinput of the second Adapter stack -
And so on, you can stack any number of Adapters
-
Connect the final Adapter stack to the model burner
-
You can also add a LoRA stack to achieve mixed LoRA+Adapter effects
常见问题与故障排除 | FAQ & Troubleshooting
Q: 加载模型时出现"tensor on different devices"错误怎么办?
Q: What should I do if I get a "tensor on different devices" error when loading the model?
A: 在加载模型后立即使用Anima 设备修复器节点,将模型连接到该节点的输入,然后使用修复后的模型进行后续操作。
A: Use the Anima Device Fix node immediately after loading the model, connect the model to the input of this node, and then use the fixed model for subsequent operations.
Q: Adapter应用后没有效果怎么办?
Q: What should I do if the Adapter has no effect after application?
A:
- 检查Adapter的强度是否大于0
- 确认Adapter文件是否正确放入了
models/anima_adapters目录 - 刷新ComfyUI网页界面
- 尝试降低或提高Adapter的强度
- 确认使用的是Anima DiT模型,其他模型不支持此Adapter
A:
- Check if the Adapter strength is greater than 0
- Confirm that the Adapter file is correctly placed in the
models/anima_adaptersdirectory - Refresh the ComfyUI web interface
- Try lowering or increasing the Adapter strength
- Confirm that you are using an Anima DiT model, other models do not support this Adapter
Q: 烧录模型时出现显存不足怎么办?
Q: What should I do if I get out of memory when baking the model?
A:
- 将
device参数设置为"cpu",使用CPU进行烧录(速度较慢) - 关闭其他占用显存的程序
- 减少同时烧录的LoRA和Adapter数量
- 使用
float16或bfloat16数据类型
A:
- Set the
deviceparameter to "cpu" to use CPU for baking (slower) - Close other programs that occupy VRAM
- Reduce the number of LoRAs and Adapters being baked at the same time
- Use
float16orbfloat16data type
Q: 风格参考效果不好怎么办?
Q: What should I do if the style reference effect is not good?
A:
- 使用高质量的参考图像
- 确保参考图像的风格特征明显
- 尝试调整
normalize参数 - 确认
target_dim与Adapter要求的维度一致 - 尝试不同的Adapter强度
A:
- Use high-quality reference images
- Ensure that the reference image has obvious style features
- Try adjusting the
normalizeparameter - Confirm that
target_dimmatches the dimension required by the Adapter - Try different Adapter strengths
注意事项 | Notes
-
本插件仅支持Anima DiT系列模型,其他模型无法使用
-
Adapter文件通常以
.safetensors或.pt格式提供 -
烧录后的模型可以在任何支持Anima模型的ComfyUI环境中使用
-
建议定期更新插件以获得最新功能和修复
-
This plugin only supports Anima DiT series models, other models cannot be used
-
Adapter files are usually provided in
.safetensorsor.ptformat -
Baked models can be used in any ComfyUI environment that supports Anima models
-
It is recommended to update the plugin regularly to get the latest features and fixes