feat: add ComfyUI integration with Ansible playbook
- Add ComfyUI installation to Ansible playbook with 'comfyui' tag - Create ComfyUI requirements.txt and start.sh script - Clone ComfyUI from official GitHub repository - Symlink HuggingFace cache for Flux model access - ComfyUI runs on port 8188 with CORS enabled - Add ComfyUI to services list in playbook 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
77
playbook.yml
77
playbook.yml
@@ -17,6 +17,7 @@
|
||||
# python - Python environment setup
|
||||
# dependencies- Install Python packages
|
||||
# models - Download AI models
|
||||
# comfyui - Install and configure ComfyUI
|
||||
# tailscale - Install and configure Tailscale
|
||||
# systemd - Configure systemd services
|
||||
# validate - Health checks and validation
|
||||
@@ -63,6 +64,9 @@
|
||||
- name: musicgen
|
||||
port: 8003
|
||||
script: models/musicgen/server.py
|
||||
- name: comfyui
|
||||
port: 8188
|
||||
script: models/comfyui/start.sh
|
||||
|
||||
tasks:
|
||||
#
|
||||
@@ -154,6 +158,79 @@
|
||||
executable: pip3
|
||||
become: true
|
||||
|
||||
#
|
||||
# ComfyUI Installation
|
||||
#
|
||||
- name: Install and configure ComfyUI
|
||||
tags: [comfyui]
|
||||
block:
|
||||
- name: Check if ComfyUI is already installed
|
||||
stat:
|
||||
path: "{{ workspace_dir }}/ComfyUI"
|
||||
register: comfyui_check
|
||||
|
||||
- name: Clone ComfyUI repository
|
||||
git:
|
||||
repo: https://github.com/comfyanonymous/ComfyUI.git
|
||||
dest: "{{ workspace_dir }}/ComfyUI"
|
||||
version: master
|
||||
update: yes
|
||||
when: not comfyui_check.stat.exists
|
||||
|
||||
- name: Install ComfyUI dependencies
|
||||
pip:
|
||||
requirements: "{{ workspace_dir }}/ComfyUI/requirements.txt"
|
||||
executable: pip3
|
||||
become: true
|
||||
|
||||
- name: Install additional ComfyUI dependencies
|
||||
pip:
|
||||
requirements: "{{ ai_dir }}/models/comfyui/requirements.txt"
|
||||
executable: pip3
|
||||
become: true
|
||||
|
||||
- name: Create ComfyUI models directory structure
|
||||
file:
|
||||
path: "{{ workspace_dir }}/ComfyUI/models/{{ item }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
loop:
|
||||
- checkpoints
|
||||
- unet
|
||||
- vae
|
||||
- loras
|
||||
- clip
|
||||
- controlnet
|
||||
|
||||
- name: Create symlink for Flux model in ComfyUI
|
||||
file:
|
||||
src: "{{ cache_dir }}"
|
||||
dest: "{{ workspace_dir }}/ComfyUI/models/huggingface_cache"
|
||||
state: link
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Make ComfyUI start script executable
|
||||
file:
|
||||
path: "{{ ai_dir }}/models/comfyui/start.sh"
|
||||
mode: '0755'
|
||||
|
||||
- name: Display ComfyUI setup summary
|
||||
debug:
|
||||
msg: |
|
||||
✓ ComfyUI installed successfully!
|
||||
|
||||
Directory: {{ workspace_dir }}/ComfyUI
|
||||
Port: 8188
|
||||
HuggingFace Cache: {{ cache_dir }}
|
||||
|
||||
To start ComfyUI:
|
||||
bash {{ ai_dir }}/models/comfyui/start.sh
|
||||
|
||||
Or manually:
|
||||
cd {{ workspace_dir }}/ComfyUI && python3 main.py --listen 0.0.0.0 --port 8188
|
||||
|
||||
Access: http://localhost:8188
|
||||
|
||||
#
|
||||
# Download AI Models
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user