docs/usage/providers/comfyui.mdx
---
title: Using ComfyUI in LobeHub for Image Generation
description: Learn how to configure and use the ComfyUI service in LobeHub to support high-quality image generation and editing with the FLUX model series.
tags:
- ComfyUI
- FLUX
- Text-to-Image
- Image Editing
- AI Image Generation
---
# Using ComfyUI in LobeHub
<Image alt={'Using ComfyUI in LobeHub'} cover src={'https://hub-apac-1.lobeobjects.space/docs/e9b811f248a1db2bd1be1af888cf9b9d.png'} />
This guide will walk you through how to use [ComfyUI](https://github.com/comfyanonymous/ComfyUI) in LobeHub for high-quality AI image generation and editing.
## Introduction to ComfyUI
ComfyUI is a powerful GUI for Stable Diffusion and Flow Diffusion, offering a node-based workflow interface. LobeHub integrates ComfyUI with full support for the FLUX model series, enabling both text-to-image generation and image editing.
### Key Features
- **Extensive Model Support**: Supports 223 models, including 130 FLUX and 93 SD models
- **Config-Driven Architecture**: Registry system enables intelligent model selection
- **Multi-Format Support**: Compatible with .safetensors and .gguf formats, with various quantization levels
- **Dynamic Precision Options**: Supports default, fp8_e4m3fn, fp8_e5m2, and fp8_e4m3fn_fast
- **Multiple Authentication Methods**: Supports None, Basic Auth, Bearer Token, and Custom Headers
- **Smart Component Selection**: Automatically selects optimal T5, CLIP, and VAE encoders
- **Enterprise-Grade Optimizations**: Includes NF4, SVDQuant, TorchAO, MFLUX variants
## Quick Start
### Step 1: Configure ComfyUI in LobeHub
#### 1. Open Settings
- Go to the `Settings` panel in LobeHub
- Under `AI Providers`, find the `ComfyUI` section
<Image alt={'ComfyUI Settings Panel'} inStep src={'/blog/assets17870709/3f31bc33-509f-4ad2-ba81-280c2a6ec5fa.webp'} />
#### 2. Set Connection Parameters
**Basic Configuration**:
- **Server Address**: Enter your ComfyUI server address, e.g., `http://localhost:8000`
- **Authentication Type**: Choose the appropriate method (default is None)
### Step 2: Select a Model and Generate Images
#### 1. Choose a FLUX Model
In the chat interface:
- Click the model selection button
- Choose your desired FLUX model from the ComfyUI category
<Image alt={'Select FLUX Model'} inStep src={'/blog/assets17870709/ff7ebacf-27f0-42d7-810b-00314499a084.webp'} />
#### 2. Text-to-Image Generation
**Using FLUX Schnell (Fast Generation)**:
```plaintext
Generate an image: A cute orange cat sitting on a sunny windowsill, warm lighting, detailed fur texture
Using FLUX Dev (High-Quality Generation):
Generate high quality image: City skyline at sunset, cyberpunk style, neon lights, 4K high resolution, detailed architecture
Using FLUX Kontext-dev for Editing:
Edit this image: Change the background to a starry night sky, keep the main subject, cosmic atmosphere
Then upload the original image you want to edit.
<Callout type={'info'}> Image editing requires uploading the original image first, followed by a description of the desired changes. </Callout>
ComfyUI supports four authentication methods. Choose the one that best fits your server setup and security needs:
Best for:
Configuration:
Authentication Type: None
Server Address: http://localhost:8000
Best for:
Setup:
# Install apache2-utils
sudo apt-get install apache2-utils
# Create user 'admin'
sudo htpasswd -c /etc/nginx/.htpasswd admin
Authentication Type: Basic
Server Address: https://your-domain.com
Username: admin
Password: your_secure_password
Best for:
Generate Token:
import jwt
import datetime
payload = {
'user': 'admin',
'exp': datetime.datetime.utcnow() + datetime.timedelta(days=30)
}
secret_key = "your-secret-key"
token = jwt.encode(payload, secret_key, algorithm='HS256')
print(f"Bearer Token: {token}")
LobeHub Configuration:
Authentication Type: Bearer Token
Server Address: https://your-domain.com
API Key: example-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Best for:
LobeHub Configuration:
Authentication Type: Custom
Server Address: https://your-domain.com
Custom Headers:
{
"X-API-Key": "your_api_key",
"X-Client-ID": "LobeHub"
}
Comfy-Manager is an extension manager for ComfyUI that simplifies installing and managing nodes, models, and extensions.
<details> <summary><b>📦 Steps to Install Comfy-Manager</b></summary># Navigate to ComfyUI's custom_nodes directory
cd ComfyUI/custom_nodes
# Clone the Comfy-Manager repository
git clone https://github.com/ltdrdata/ComfyUI-Manager.git
# Restart the ComfyUI server
# After restarting, you should see a "Manager" button in the UI
# Run from the ComfyUI root directory
curl -fsSL https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/install.sh | bash
http://localhost:8000Install Models:
Install Node Extensions:
Manage Installed Content: