ComfyUI-NPNet

ComfyUI-NPNet
★ 18

扩散模型噪声生成可定制采样ComfyUI节点
在ComfyUI中实现Golden-Noise/NPNet的简易版本,作为自定义采样的初始噪声与条件生成器,便于替换噪声并调试采样。
💡 在采样管线中用自定义初始噪声和提示进行替换与测试。
🍴 2 Forks💻 Python🔄 2024-12-10
📦
网盘下载
复制链接后前往夸克网盘下载
https://pan.quark.cn/s/c73fe210bae7
📄 README

ComfyUI NPNet (Golden Noise)

A very barebones mostly-copypaste implementation of https://github.com/xie-lab-ml/Golden-Noise-for-Diffusion-Models

Requirements

You need the pre-trained weights for your model. Download and place them under models/npnet in your ComfyUI folder, or add an extra path in extra_model_paths.yaml for the npnet type.

You can find safetensors-converted weights at https://huggingface.co/asagi4/NPNet

The original pickle-format checkpoints are found at https://drive.google.com/drive/folders/1Z0wg4HADhpgrztyT3eWijPbJJN5Y2jQt?usp=drive_link

Usage

Use with custom sampling and pass in an initial noise from eg. RandomNoise and a prompt as a conditioning. See tooltips on the node for an explanation for the options.

You can also run it on the CPU, though that appears to change the output for some reason.

Notes

The model works with 128×128 latents, apparently. If you pass in other shaped latents, it will reshape the noise into a square before running the noise model, and then reshape the result back to the original resolution. You can control how the reshape happens with the reshape and method parameters.

If you get an error from the timm module when running this, update your timm package. It may be too old.

You can use convert_to_safetensors.py to convert the pre-trained models into safetensors files (with fixed keys)