Skip to main content

ComfyUI

git clone --depth 1 https://github.com/comfyanonymous/ComfyUI ComfyUI
uv venv --python 3.12
uv pip install -r requirements.txt

# 启动
# http://127.0.0.1:8188
uv run ./main.py

# macOS 可能需要 nightly 版本 - 不过现在的版本一般都支持 pytorch 了
# https://developer.apple.com/metal/pytorch/
uv pip install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu

# cuda
uv pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121
#uv pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu128
uv pip install -r requirements.txt
mps.py
# 应该输出 tensor([1.], device='mps:0')

import torch
if torch.backends.mps.is_available():
mps_device = torch.device("mps")
x = torch.ones(1, device=mps_device)
print (x)
else:
print ("MPS device not found.")

ComfyUI Manager

git clone https://github.com/ltdrdata/ComfyUI-Manager custom_nodes/comfyui-manager
uv pip install -r custom_nodes/comfyui-manager/requirements.txt
uv pip install pip # 会使用 pip 安装依赖

# 代理访问
GITHUB_ENDPOINT=https://mirror.ghproxy.com \
HF_ENDPOINT=https://hf-mirror.com \
uv run ./main.py
No module named pip

使用 uv 的时候会出现

Notes

AI Art

  • Text2Img
  • Img2Img
  • Inpaint
  • Text2Video
  • Img2Video
  • Prompt
  • Negative Prompt
  • Upscale
  • Depth2Img
    • 用于将深度图转换为图像
  • ControlNet
    • 用于控制生成图像的结构和内容
    • 支持多种类型的输入图像,如边缘检测、深度图等
    • LineArt Depth OpenPose SoftEdge
  • ADetailer
    • 用于细化生成图像的细节
  • DeForm
    • 用于对生成图像进行形状变形
  • ESERGAN
    • 用于超分辨率图像生成
  • AnimateDiff
    • 用于生成动画效果
  • LoRA
    • Low-Rank Adaptation
    • 用于微调模型
    • 通过 LoRA 来控制生成图像的风格和特征
    • 物体
    • 任务
    • 风格
  • CFG - Classifier Free Guidance
    • 通过 Classifier Free Guidance 来控制生成图像的多样性和质量
  • Textural Inversion / Embeddings
    • 类似 Lora
    • 捕捉一些 concept 的特征 - 例如 手指、眼睛
  • VAE - Variational Autoencoder
    • 用于图像的编码和解码
  • 模型
    • SD 1.5
    • LAION 5B
    • SDXL
  • KSampler
    • 用于采样生成图像
    • sampler
      • DDIM
      • PLMS
      • DPM2 a
      • DPM2
      • DPM++ 2S
      • DPM++ 2M
      • DPM++ SDE
      • LMS
      • Heun
    • scheduler
      • Karras
  • 3:4
    • 384x512
    • 432x576
    • 576x768
    • 768x1024
    • 864x1152
    • 912x1216
    • 1008x1344
  • 9:16

参考

FAQ

nvcc --version
RuntimeError: CUDA error: no kernel image is available for execution on the device
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.