前两天看了关于SDXL-Lightning的论文:
https://arxiv.org/abs/2402.13929
添加图片注释,不超过 140 字(可选)
想测试一下效果。就安装了ComfyUI,并进行了测试。环境为ubuntu 18,Nvidia GPU,因为机器上已经安装过Anaconda,Cuda,pytorch等,所以主要就是下载ComfuUI,安装requirements,配置Manager等。
1 ComfyUI下载及安装
Github地址:
https://github.com/comfyanonymous/ComfyUI
Git clone 代码库:
git clone https://github.com/comfyanonymous/ComfyUI
把 SD checkpoints(即大的 ckpt/safetensors 文件)放在:models/checkpoints
把 VAE 放在:models/vae
在 ComfyUI 文件夹内打开终端,然后安装依赖项:
pip install -r requirements.txt
完成后,您应该已经安装了所有内容,可以继续运行 ComfyUI。
执行
python main.py
提示启动在127.0.0.1:8188。不过远程访问发现访问不了。修改为
python main.py --listen 0.0.0.0
添加图片注释,不超过 140 字(可选)
访问页面,画了一张图:
添加图片注释,不超过 140 字(可选)
2 ComfyUI Manager 安装
GitHub: https://github.com/ltdrdata/ComfyUI-Manager
按以下步骤安装
- goto ComfyUI/custom_nodes dir in terminal(cmd)
- git clone https://github.com/ltdrdata/ComfyUI-Manager.git
- Restart ComfyUI
重启后发现:
添加图片注释,不超过 140 字(可选)
添加图片注释,不超过 140 字(可选)
为了方便看图,又安装了comfyui-browser,直接在manager里面点击Install custom Nodes,然后搜索“comfyui-browser”后点击Install即可
添加图片注释,不超过 140 字(可选)
添加图片注释,不超过 140 字(可选)
添加图片注释,不超过 140 字(可选)
3 下载模型并测试
SDXL-Lightning
Hugging Face上的模型地址
ByteDance/SDXL-Lightning · Hugging Face
添加图片注释,不超过 140 字(可选)
不过从HuggingFace上下载速度就太慢了,看了一下魔搭,也有:
SDXL-Lightning
添加图片注释,不超过 140 字(可选)
看了说明:
Checkpoints
- sdxl_lightning_Nstep.safetensors: All-in-one checkpoint, for ComfyUI.
- sdxl_lightning_Nstep_unet.safetensors: UNet checkpoint only, for Diffusers.
- sdxl_lightning_Nstep_lora.safetensors: LoRA checkpoint, for Diffusers and ComfyUI.
准备先从
SDXL-Lightning/sdxl_lightning_8step.safetensors 开始测试。
wget "https://www.modelscope.cn/api/v1/models/AI-ModelScope/SDXL-Lightning/repo?Revision=master&FilePath=sdxl_lightning_8step.safetensors"
下载后需要改名:
mv 'repo?Revision=master&FilePath=sdxl_lightning_8step.safetensors' sdxl_lightning_8step.safetensors
其他step的也都一样处理即可。
SDXL-turbo(对比用):
也是从魔搭下载:
wget:https://www.modelscope.cn/api/v1/models/AI-ModelScope/sdxl-turbo/repo?Revision=master&FilePath=sd_xl_turbo_1.0_fp16.safetensors
mv 'repo?Revision=master&FilePath=sd_xl_turbo_1.0_fp16.safetensors' sd_xl_turbo_1.0_fp16.safetensors
ComfyUI应用方法:
关于在ComfyUI Usage调用的方法,详见:
ByteDance/SDXL-Lightning · Hugging Face
我测试的是4-Step, 8-Step,所以按照以下步骤即可:
2-Step, 4-Step, 8-Step Full
- Download the full checkpoint (sdxl_lightning_Nstep.safetensors) to /ComfyUI/models/checkpoints.
- Download our ComfyUI full workflow.
添加图片注释,不超过 140 字(可选)
下载work flow后直接Load即可使用:
添加图片注释,不超过 140 字(可选)
测试效果:
不知道怎么回事,直接Load后配置没有直接调整,我就又手工调了一下:
添加图片注释,不超过 140 字(可选)
添加图片注释,不超过 140 字(可选)
a beautiful girl smiling
4-step
添加图片注释,不超过 140 字(可选)
8-step
添加图片注释,不超过 140 字(可选)
space girl| standing alone on hill| centered| detailed gorgeous face| anime style| key visual| intricate detail| highly detailed| breathtaking| vibrant| panoramic| cinematic| Carne Griffiths| Conrad Roset| ghibli
8-step:
添加图片注释,不超过 140 字(可选)
4-step:
添加图片注释,不超过 140 字(可选)