Skip to content
Device Family
Device
OS

Generating images with ComfyUI and Z Image Turbo

Create stunning AI-generated images using ComfyUI with Z Image Turbo.

Generating images with ComfyUI and Z Image Turbo

Overview

ComfyUI is a powerful, node-based interface for Stable Diffusion and other diffusion models. Unlike traditional text-to-image interfaces with simple prompt boxes, ComfyUI exposes the entire image generation pipeline as a visual graph, giving you fine-grained control over every step from text encoding to latent space manipulation to final decoding.

This tutorial teaches you how to use ComfyUI with the Z Image Turbo model on your GPU to generate high-quality AI images.

What You’ll Learn

  • How to launch ComfyUI and load the Z-Image Turbo template
  • Understanding diffusion pipeline components
  • Generating images and tuning generation parameters
  • Saving and sharing workflows

Installing Dependencies

ComfyUI

  1. Download the Windows ComfyUI v0.10.0 installer from download.comfy.org.
  2. Choose your hardware setup: Select AMD ROCm.
  3. Choose where to install ComfyUI: Use the default path or your preferred folder.
  4. Desktop App Settings: We recommend unselecting “Automatic Updates” to ensure you are using the recommended version of this app.
  5. Press “Next” to begin installation.

Create a Virtual Environment

On Linux, open a terminal in the directory of your choice and run the following prompt to create a venv with ROCm+Pytorch already installed:

Terminal window
sudo apt update
sudo apt install -y python3-venv
python3 -m venv llm-env --system-site-packages
source llm-env/bin/activate

On Linux, open a terminal in the directory of your choice and run the following prompt to create a venv:

Terminal window
sudo apt update
sudo apt install -y python3-venv
python3 -m venv llm-env
source llm-env/bin/activate

Clone ComfyUI

Terminal window
git clone https://github.com/Comfy-Org/ComfyUI.git

Optionally checkout a specific version

Terminal window
git checkout v0.17.2

Install ComfyUI requirements

With the Python virtual environment activated, run:

Terminal window
pip install -r requirements.txt

AMD GPU Driver

Update to the latest AMD GPU driver using AMD Software: Adrenalin Edition™.

  1. Open AMD Software: Adrenalin Edition from your Start menu or system tray.
  2. Navigate to Driver and Software, click Manage Updates.
  3. If an update is available, follow the prompts to download and install.

Download and install the latest AMD GPU driver for Linux:

  1. Visit the AMD Linux Drivers page.
  2. Follow the installation instructions provided on the download page.

ComfyUI

  1. Download the Windows ComfyUI v0.10.0 installer from download.comfy.org.
  2. Choose your hardware setup: Select AMD ROCm.
  3. Choose where to install ComfyUI: Use the default path or your preferred folder.
  4. Desktop App Settings: We recommend unselecting “Automatic Updates” to ensure you are using the recommended version of this app.
  5. Press “Next” to begin installation.

Create a Virtual Environment

On Linux, open a terminal in the directory of your choice and run the following prompt to create a venv with ROCm+Pytorch already installed:

Terminal window
sudo apt update
sudo apt install -y python3-venv
python3 -m venv llm-env --system-site-packages
source llm-env/bin/activate

On Linux, open a terminal in the directory of your choice and run the following prompt to create a venv:

Terminal window
sudo apt update
sudo apt install -y python3-venv
python3 -m venv llm-env
source llm-env/bin/activate

Clone ComfyUI

Terminal window
git clone https://github.com/Comfy-Org/ComfyUI.git

Optionally checkout a specific version

Terminal window
git checkout v0.17.2

Install ComfyUI requirements

With the Python virtual environment activated, run:

Terminal window
pip install -r requirements.txt

ROCm

1. Install AMD ROCm™ software on Linux (Ubuntu 24.04)

These steps install the system ROCm 7.2.1 runtime on Ubuntu 24.04.

Terminal window
sudo apt update
wget https://repo.radeon.com/amdgpu-install/7.2.1/ubuntu/noble/amdgpu-install_7.2.1.70201-1_all.deb
sudo apt install ./amdgpu-install_7.2.1.70201-1_all.deb
sudo amdgpu-install -y --usecase=rocm --no-dkms

2. Set the correct user permissions

Terminal window
sudo usermod -aG render,video $USER

3. Reboot the system

Terminal window
sudo reboot

This is important for the runtime stack and permissions to settle.

4. Verify that ROCm is installed correctly and usable

Terminal window
ls -l /opt/rocm
ls -l /opt/rocm/lib/libroctx64.so*
# Check ROCm device files (Device files owned by the render group should be visible)
ls -l /dev/kfd
ls -l /dev/dri/renderD*
# Check user groups ($USER should be listed in both render and video)
id
groups
# Check ROCm with rocminfo ('Permission denied' error should NOT be seen)
rocminfo | sed -n '1,120p'
# Check installed ROCm version
cat /opt/rocm/.info/version

Refer this official documentation for more info.


AMD GPU Driver

Update to the latest AMD GPU driver using AMD Software: Adrenalin Edition™.

  1. Open AMD Software: Adrenalin Edition from your Start menu or system tray.
  2. Navigate to Driver and Software, click Manage Updates.
  3. If an update is available, follow the prompts to download and install.

Download and install the latest AMD GPU driver for Linux:

  1. Visit the AMD Linux Drivers page.
  2. Follow the installation instructions provided on the download page.

PyTorch

Install PyTorch with AMD ROCm™ software support in the created virtual environment:

Terminal window
python -m pip install --upgrade pip
python -m pip install --force-reinstall --no-cache-dir --index-url https://repo.amd.com/rocm/whl/gfx1151/ torch torchvision torchaudio
Terminal window
python -m pip install --upgrade pip
python -m pip install --force-reinstall --no-cache-dir --index-url https://repo.amd.com/rocm/whl/gfx1152/ torch torchvision torchaudio
Terminal window
python -m pip install --upgrade pip
python -m pip install --force-reinstall --no-cache-dir --index-url https://repo.amd.com/rocm/whl/gfx1150/ torch torchvision torchaudio

See this link for details.

Launching ComfyUI

To launch ComfyUI on Windows, click the ComfyUI Desktop Launcher which is found on your Desktop. You will see the following page:

Templates button in the left toolbar

Click Install ComfyUI and follow the steps. Choose AMD as the version and use default install locations. When finished, you should see the following:

Templates button in the left toolbar

Click the blue Launch button to open ComfyUI in its own window.

To launch ComfyUI on Linux, click the ComfyUI shortcut in the taskbar. It should open by itself in a browser window.

Alternatively,

  1. Use the terminal to navigate to /usr/local/bin/ComfyUI/ (or to the appropriate folder if installed manually)
  2. Run python3 main.py --use-pytorch-cross-attention
  3. The interface is accessible at http://127.0.0.1:8188. Keep the terminal window open while using ComfyUI.

To launch ComfyUI on Windows, simply click the ComfyUI shortcut on your Desktop.

To launch ComfyUI:

  1. Navigate to /usr/local/bin/ComfyUI/ (or to the appropriate folder if installed manually)
  2. Run python3 main.py --use-pytorch-cross-attention

ComfyUI starts a local web server. Open your browser to http://127.0.0.1:8188 to access the interface.

Finding the Z-Image Turbo Template

Before generating images, you need to load the Z-Image Turbo template. Here’s how to find it:

  1. Look at the far left edge of the screen—there’s a vertical toolbar running from top to bottom on the leftmost side of the app.

  2. Find the folder icon—in that left toolbar, look for an icon that looks like a folder. When you hover over it, it’s labeled “Templates.”

Templates button in the left toolbar

  1. Click the folder icon—this opens the Templates panel.

  2. Search for “Z-Image Turbo”—use the search bar or scroll through the available templates to find the Z-Image Turbo Text To Image workflow, then click to load it.

Selecting the Z-Image Turbo template

Downloading Models

ComfyUI Models

If you previously deleted pre-downloaded ComfyUI models or want to download those for the first time, simply press the Download button on each of the models when prompted that missing models have been detected. You may need to manually place the model files in the correct locations.

ComfyUI Download Models

Understanding the Interface

When the Z-Image Turbo template loads, you’ll see a canvas with 2 main nodes. The first node is called ‘Text to Image (Z-Image-Turbo), and the second node is for viewing the image.

ComfyUI Main Node

On the Z-Image node, click the top right button to expand the Node and see the subgraph.

ComfyUI Node Subgraph

Pipeline Components

The Z-Image Turbo workflow uses four key model components that work together:

ComponentRole
Text Encoder (Qwen 3 4B)Converts your text prompt into embeddings the diffusion model understands
Diffusion Model (Z-Image Turbo)The core neural network that iteratively denoises latent representations into images
VAE (Variational Autoencoder)Encodes images to/from latent space (decodes the final latents into pixels)
LoRA (optional)Lightweight adapters that modify style or subject without retraining the base model

Each node in the workflow corresponds to one of these components. Data flows left-to-right: text → embeddings → guided denoising → latents → final image.

Generating Your First Image

The Z-Image Turbo model is already loaded. To generate an image:

  1. Enter your prompt in the main Z-Image Node. Be descriptive. Here is an example:
A photorealistic red fox sitting in a snowy forest clearing,
morning light filtering through pine trees,
detailed fur texture, bokeh background
  1. (Optional): Confirm or tweak any other specific settings within the subgraph.
  2. Click the blue “Run Workflow” in the right corner (or press Ctrl+Enter)
  3. Watch the nodes highlight as each step executes

The entire workflow execution should complete in less than 30 seconds. Your generated image appears in the Save Image node and is saved to the output/ folder.

Adjusting Generation Parameters

KSampler Settings

The KSampler node controls the core diffusion process:

ParameterWhat It ControlsRecommended for Z-Image Turbo
stepsNumber of denoising iterations4–10 (turbo models are distilled for fewer steps)
cfgClassifier-free guidance scale—how closely to follow the prompt1.0–2.0 (turbo models use very low guidance)
sampler_nameDenoising algorithmeuler and res_multistep work well for turbo models
schedulerNoise schedule curvenormal or simple
seedRandom seed for reproducibilitySet fixed values to iterate on a composition

Image Size

To adjust output dimensions, find the Empty Latent Image node and modify width and height. Keep dimensions at or below 1024 pixels on the longest side for optimal quality.

ModelSamplingAuraFlow

The ModelSamplingAuraFlow node is a specialized sampling modifier that adjusts how the diffusion process handles noise scheduling. You’ll see this node connected to the model output in the Z-Image Turbo workflow.

ParameterWhat It ControlsRecommended Values
shiftAdjusts the noise schedule timing—higher values push more detail refinement to later steps1.0–4.0 (default is 3.0)

When to adjust shift:

  • Lower values (1.0–2.0): Faster convergence, good for simple compositions
  • Higher values (3.0–4.0): More gradual refinement, can improve fine details in complex scenes

The AuraFlow sampling method is specifically designed for flow-matching models like Z-Image Turbo, ensuring proper noise distribution throughout the generation process.

Working with Workflows

Saving Workflows

Click the Save button in the menu to export your workflow as a JSON file. This captures:

  • All nodes and their parameters
  • All connections between nodes
  • Current prompt text

Loading Workflows

Drag a workflow JSON file onto the canvas, or use Load from the menu. The Z-Image Turbo workflow you see by default is loaded from a saved workflow file.

Sharing Workflows

Workflows are self-contained—share the JSON file with colleagues, and they can reproduce your exact setup. This makes ComfyUI excellent for collaborative experimentation.

Next Steps

  • Explore LoRA nodes: Apply style or subject adapters without retraining
  • Add negative prompts: Connect a second CLIP Text Encode node to the negative conditioning input of KSampler to guide the model away from unwanted features like blur, artifacts, or watermarks
  • Build custom workflows: Chain multiple generations, add upscaling, or create image variations
  • Browse community workflows: ComfyUI Examples has many ready-to-use workflows

ComfyUI’s strength is experimentation: connect nodes differently, adjust parameters, and observe how each change affects the output. This hands-on exploration builds intuition for how diffusion models work.

For more information, check out the ComfyUI Documentation.

Need help with this playbook?

Run into an issue or have a question? Open a GitHub issue and our team will take a look.