Skip to content

2.1.2 Frontend: ComfyUI

av edited this page Jan 25, 2025 · 3 revisions

Handle: comfyui URL: http://localhost:34031

Website Dynamic JSON Badge Matrix
![][github-release-date-shgield]

ComfyUI Screenshot

This ui will let you design and execute advanced stable diffusion pipelines using a graph/nodes/flowchart based interface.

Note

The initial download of the models will take upwards of 10 minutes, depending on your internet connection. Monitor the logs during the startup to see the progress.

Starting

# [Optional] Pre-pull the comfyui images, ~4GB
# otherwise will be pulled on start
harbor pull comfyui

# Start the service
# Note that this will take a really long time
# for the initial model download
# [Optional] --tail will automatically follow the logs
harbor up comfyui --tail

# See service logs
harbor logs comfyui -n 100

# [Optional] once started, open the UI
# in your default browser
harbor open comfyui
  • When running with other inference backends - ensure that you have VRAM available for the models. Unlike ollama, comfyui won't try to offload if there's not enough VRAM. You can check the VRAM usage with harbor top
  • Harbor's default workflow for the comfyui is very basic to get you started, explore the ComfyUI documentation to learn more about the advanced features

Authentication

Note

Harbor uses AI Dock to run ComfyUI. By default, it has authentication disabled, but you should re-enable it if exposing the ComfyUI over the network (sadly Open WebUI integration won't work when auth is enabled).

# Enable web AI Dock auth
harbor comfyui auth true

# Get current login credentials
harbor comfyui user
harbor comfyui password

# Set new login credentials
harbor comfyui user me
harbor comfyui password mypassword

# Underlying config aliases and ENV variables
harbor config get comfyui.user     # HARBOR_COMFYUI_USER
harbor config get comfyui.password # HARBOR_COMFYUI_PASSWORD

# Underlying config aliases and ENV variables
harbor config get comfyui.auth     # HARBOR_COMFYUI_AUTH

When enabled, the comfyui.password can also be used as a token for ComfyUI API. See this file in ai-dock to see all possible auth ways.

Usage

Harbor uses AI Dock setup that includes a provisioning script for Flux models compatible with the Open WebUI. You can find provisioning script documentation here, and list of available scripts in the AI Dock's ComfyUI repo here.

Configuration

By default, Harbor will load ComfyUI pre-configured to run FLUX models.

ComfyUI is mainly configured via the UI itself. Harbor will use the comfyui folder in the workspace to store the configuration files.

# Show ComfyUI workspace folder
echo $(harbor home)/comfyui

Important

ComfyUI uses pip dependencies for managing custom nodes. Those are not automatically synced to the local workspace, so won't automatically persist between Harbor restarts.

# Sync workspace after updating the nodes
harbor comfyui workspace sync

Additional configuration via Harbor CLI:

# See current version
harbor comfyui version

# Set the version to use
# Accepts package tags from
# AI Dock GHCR: https://github.com/ai-dock/comfyui/pkgs/container/comfyui
harbor comfyui version latest-rocm

Following options are available via harbor config:

# The port of the ComfyUI's web interface
COMFYUI_HOST_PORT              34031

# web interface for AI Dock UI from ComfyUI container
COMFYUI_PORTAL_HOST_PORT       34032

# Docker image tag to use, can be set to
# "latest-rocm" or "latest-cpu" see:
# https://github.com/ai-dock/comfyui/pkgs/container/comfyui
COMFYUI_VERSION                latest-cuda

# Location of the folder where ComfyUI will store
# models, nodes, and other configuration files
# Has to be either relative to $(harbor home) or an absolute path
COMFYUI_WORKSPACE              ./comfyui/workspace

# Enable or disable authentication
# (AI Dock) feature
COMFYUI_AUTH                   false

# User and password for the AI Dock
# If the auth is enabled
COMFYUI_USER                   harbor
COMFYUI_PASSWORD               sk-comfyui

# Additional arguments for the ComfyUI
COMFYUI_ARGS

# The URL to the provisioning script
# that'll be run to initialise fresh ComfyUI instance
# You can find more provisioning scripts in the AI Dock repo:
# https://github.com/ai-dock/comfyui/tree/main/config/provisioning
COMFYUI_PROVISIONING           https://raw.githubusercontent.com/av/harbor/main/comfyui/provisioning.sh
Open WebUI

When running ComfyUI, Open WebUI will also be pre-configured to run a FLUX-based workflow for generating images.

Please refer to the official Open WebUI documentation to adjust the image generation workflow.

Note

Open WebUI will not work with ComfyUI when the authentication is enabled.

Documentation

Clone this wiki locally