Video coming soon…

🎨 Setup ComfyUI — Self-Hosted Stable Diffusion GUI

Deploy ComfyUI, the powerful node-based interface for Stable Diffusion image generation with full pipeline control on your own server.

⚠️ This script is provided for demo and testing purposes only. Not intended for production use.

📦 Resources & Setup Scripts

Grab the automated bash script from GitHub to follow along with the video.

Automated install — ComfyUI image generation running in one command.
View on GitHub

Quick Install:

wget https://raw.githubusercontent.com/mhmdali94/Docker/main/ai/comfyui/comfyui-ubuntu.sh
chmod +x comfyui-ubuntu.sh
sudo bash comfyui-ubuntu.sh

Tutorial Steps

1 Download & Run the Installer (GPU recommended — also runs on CPU)

The script installs Docker and the NVIDIA container toolkit if a GPU is detected, then pulls the ComfyUI image and starts the container with GPU passthrough enabled. On CPU-only servers it will still run but image generation will be significantly slower.

wget https://raw.githubusercontent.com/mhmdali94/Docker/main/ai/comfyui/comfyui-ubuntu.sh
chmod +x comfyui-ubuntu.sh
sudo bash comfyui-ubuntu.sh

2 Access the Web UI

Open your browser and navigate to the ComfyUI interface. You will see the node-based canvas with a default txt2img workflow already loaded. The interface shows connected nodes representing the full Stable Diffusion pipeline from prompt to output.

http://<your-server-ip>:8188

3 Load a Workflow

Drag and drop a JSON workflow file onto the canvas to load a community workflow, or use the default txt2img workflow. You must add a checkpoint model — place a .safetensors file in the models/checkpoints/ directory and click Refresh in the Load Checkpoint node to detect it.

4 Generate Your First Image

Enter your positive and negative prompts in the CLIP Text Encode nodes, adjust the sampler settings (steps, CFG scale, seed), and click "Queue Prompt" to start generation. Watch the progress in real time in the UI — the generated image will appear in the Preview Image node when complete.

Ports Used

PortPurpose
8188ComfyUI Web UI & API

Overview

ComfyUI is a node-based graphical interface for Stable Diffusion that gives users precise control over the image generation pipeline. Each step — model loading, sampling, conditioning, VAE decoding — is represented as a node that you connect visually, enabling complex and repeatable workflows.

Why Use It

ComfyUI offers unmatched flexibility compared to Automatic1111 or Fooocus. You can chain multiple models, use ControlNet, LoRA, IP-Adapter, and custom nodes in complex workflows that would be impossible with a simple form-based UI. It is the standard tool for advanced Stable Diffusion users.

When You Need It

    Who Should Use It

      Real Use Cases

        Main Features

          How to Use After Installation

            Security Best Practices

              Ports and Firewall Notes

              ComfyUI runs on port 8188. Do not expose this port publicly without authentication — it has no built-in login. For remote access, use an SSH tunnel (ssh -L 8188:localhost:8188 user@server) or place it behind a reverse proxy with HTTP basic authentication.

              Backup and Maintenance

                Common Mistakes

                  Troubleshooting

                    Alternatives

                    Alternatives include Automatic1111 (feature-rich, form-based UI), Fooocus (simplified, beginner-friendly), InvokeAI (polished, self-hosted), and Replicate (cloud API). Choose ComfyUI for maximum workflow control and advanced pipeline construction.

                    When Not to Use It

                    Avoid ComfyUI if you are a beginner just wanting to generate images — Fooocus or Automatic1111 have friendlier interfaces. Also avoid on systems without a discrete GPU — generation will be impractically slow on CPU alone.

                    PrismaTechWork Professional Help

                    PrismaTechWork provides end-to-end infrastructure services — from initial deployment and security hardening to ongoing monitoring, automated backups, and dedicated support. Whether you need a single-server setup or a multi-site network, our team ensures your infrastructure is built right, secured properly, and maintained reliably.

                      Contact Us

                      Frequently Asked Questions

                      Does ComfyUI require a GPU?

                      A GPU is strongly recommended. With an NVIDIA GPU and CUDA support, image generation takes 5 to 30 seconds depending on the model and settings. On CPU, the same process takes 30 minutes or more, making practical use difficult. AMD GPU support via ROCm is available but requires additional configuration.

                      What models work with ComfyUI?

                      ComfyUI supports Stable Diffusion 1.5, SDXL, SDXL Turbo, SD 2.x, Flux, and many other diffusion model variants. Download checkpoint files in .safetensors or .ckpt format from Hugging Face or CivitAI and place them in the models/checkpoints directory.

                      What is a workflow in ComfyUI?

                      A workflow is a saved node graph that defines the entire image generation pipeline — which model to load, the sampler settings, conditioning text, resolution, and output format. Workflows are saved as JSON files and can be shared and imported. The ComfyUI community has thousands of prebuilt workflows for specific use cases.

                      Can I use ComfyUI via API?

                      Yes. ComfyUI has a REST API and WebSocket interface. Submit a workflow JSON via the API to queue a generation job. The server processes it and returns the output image. This enables building applications on top of ComfyUI or scripting batch generation pipelines.

                      How do I install custom nodes?

                      The easiest way is to install the ComfyUI Manager custom node first. ComfyUI Manager adds a GUI for browsing, installing, and updating custom nodes from the community registry without needing to use the command line.

                      How much VRAM do I need?

                      For SD 1.5 models, 4 to 6 GB VRAM is sufficient. For SDXL, plan for 8 to 12 GB. Flux models typically require 12 to 24 GB. ComfyUI has memory management options to reduce VRAM usage at the cost of speed, such as --lowvram and --medvram flags.

                      Can I use ControlNet with ComfyUI?

                      Yes. ControlNet is one of ComfyUI's most powerful features. Download ControlNet model files and place them in the models/controlnet directory. Add ControlNet nodes to your workflow to guide image generation with depth maps, pose skeletons, edge detection, or other conditioning inputs.

                      How do I share ComfyUI with teammates?

                      Place ComfyUI behind a reverse proxy with HTTP basic authentication (Nginx, Caddy, or NPM). This adds a username and password prompt before the ComfyUI interface. Use a VPN for stricter access control. Note that all users share the same queue — there is no per-user isolation natively.