Skip to content

KatherLab/z-image-generation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Z-Image Turbo Web Application

A web application for generating images using Z-Image-Turbo model on DGX Spark with GB10 GPU (ARM).

Features

  • 🎨 Web interface for image generation
  • ⚡ Fast generation with Z-Image-Turbo
  • 🎛️ Customizable parameters (width, height, steps, seed)
  • 💾 Automatic image saving
  • 🐳 Docker & GPU support

Quick Start

Using Docker Compose (Recommended)

  1. Build and start the service:
docker-compose up -d --build
  1. Access the web interface:
http://localhost:5000
  1. View logs:
docker-compose logs -f
  1. Stop the service:
docker-compose down

Using Command Line Script

You can also generate images directly from the command line:

python image_generation.py --prompt "Your prompt here" --output output.png

Options:

  • --prompt, -p: Text prompt for image generation (required)
  • --output, -o: Output filename (default: /tim/data/z-image-turbo/output.png)
  • --width, -w: Image width (default: 1024)
  • --height: Image height (default: 1024)
  • --steps, -s: Number of inference steps (default: 9)
  • --seed: Random seed for reproducibility (default: 42)

Project Structure

z_image/
├── webapp/
│   ├── app.py                 # Flask application
│   ├── requirements.txt       # Python dependencies
│   └── templates/
│       └── index.html         # Web interface
├── image_generation.py        # CLI script
├── Dockerfile                 # Container definition
├── docker-compose.yml         # Service orchestration
└── README.md                  # This file

Configuration

GPU Settings

The docker-compose.yml is configured for:

  • NVIDIA GB10 GPU (ARM architecture)
  • Device ID 0
  • 8GB shared memory

Output Directory

Generated images are saved to /tim/data/z-image-turbo/

Model Cache

HuggingFace models are cached in a Docker volume to avoid re-downloading.

API Endpoints

  • GET / - Web interface
  • POST /generate - Generate image from prompt
  • GET /image/<filename> - Serve generated images
  • GET /health - Health check

Requirements

  • Docker & Docker Compose
  • NVIDIA GPU with CUDA support
  • NVIDIA Container Toolkit

Troubleshooting

GPU not detected

nvidia-smi  # Verify GPU is available
docker run --rm --gpus all nvidia/cuda:12.1.0-runtime-ubuntu22.04 nvidia-smi

Port already in use

Change the port mapping in docker-compose.yml:

ports:
  - "5001:5000"  # Use port 5001 instead

Out of memory

Reduce image size or batch size in the web interface.

About

generate images with z-image turbo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published