/ Модель

Характеристики

Лицензия
Apache 2.0
Опубликована
26 дек 2025

z-image-control-turbo-unified-8-steps-v2

Генерация изображенийТекст → изображение4 профессии
71скачиваний за 30 дней2лайкавеса обновлены26 дек 2025

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Объединённая модель на базе Z-Image Turbo и ControlNet для генерации и редактирования изображений с текстовым и структурным управлением.

Z-Image Turbo Control Unified V2.1 — специализированная модель генерации изображений, объединяющая трансформер Z-Image Turbo с ControlNet в единой архитектуре. По README, модель разработана автором репозитория, обучена с нуля на наборе из миллиона изображений и поддерживает генерацию по текстовому описанию, преобразование изображений, управление по структурным условиям и заполнение масок. Для управления композицией доступны условия Canny, HED, глубина, поза и MLSD; предусмотрены режимы инпейнтинга с сохранением фона и настройка силы управляющего сигнала.

Модель поставляется в формате Diffusers с точностью BF16, а также в квантизированных GGUF Q4_K_M и Q8_0 вариантах для запуска при ограниченной видеопамяти. README рекомендует около 6–8 ГБ видеопамяти для GGUF и 24 ГБ или более для BF16. Репозиторий распространяется по лицензии Apache-2.0. Заявленный быстрый режим на 8 шагах не гарантирует одинаковое качество для всех условий: автор отмечает, что при усилении ControlNet может потребоваться увеличить число шагов, а подробный промпт помогает повысить стабильность.

Сценарии применения

  • генерация изображения по текстовому описанию
  • перерисовка исходного изображения с помощью промпта
  • генерация изображения по контурам Canny или HED
  • создание изображений с заданной позой или картой глубины
  • заполнение и замена областей изображения по маске

Ограничения

Для надёжного результата рекомендуется подробный промпт; при повышении силы управляющего сигнала может понадобиться увеличить число шагов генерации. Режим BF16 требует существенно больше видеопамяти, чем квантизированные GGUF варианты.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Для каких профессий подходит4

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Z-Image Turbo Control Unified V2 (V2.1 8-Steps)

Github Original Repo

This repository hosts the Z-Image Turbo Control Unified V2 model. This is a specialized architecture that unifies the powerful Z-Image Turbo base transformer with enhanced ControlNet capabilities into a single, cohesive model. This unified pipeline supports multiple generation modes in one place: Text-to-Image, Image-to-Image, ControlNet, and Inpainting.

Unlike traditional pipelines where ControlNet is an external add-on, this model integrates control layers directly into the transformer structure. This enables Unified GGUF Quantization, allowing the entire merged architecture (Base + Control) to be quantized (e.g., Q4_K_M, Q8_0) and run efficiently on consumer hardware with limited VRAM. This version also introduces significant optimizations, architectural improvements, and bug fixes for features like group_offload.

📥 Installation

To set up the environment, simply install the dependencies:

#create virtual env
python -m venv venv

# Activate your venv

#upgrade pip
python.exe -m pip install --upgrade pip

#install requirements
pip install -r requirements.txt

Note: This repository contains a diffusers_local folder with the custom ZImageControlUnifiedPipeline and transformer logic required to run this specific architecture.

🚀 Usage

This repository provides separate, easy-to-use scripts for each generation task.

High-Level Scripts

  • infer_t2i.py: For Text-to-Image generation.
  • infer_i2i.py: For Image-to-Image generation.
  • infer_controlnet.py: For ControlNet-guided generation (Pose, Canny, Depth, etc.).
  • infer_inpaint.py: For all inpainting tasks.

Hardware Options

Option 1: Low VRAM (GGUF) - Recommended

Use this version if you have limited VRAM (e.g., 6GB - 8GB). It loads the model from a quantized GGUF file. To use it, set use_gguf = True in the desired inference script and provide the path to the .gguf file.

Key Features:

  • Loads the unified transformer from a single 4-bit or 8-bit quantized file.
  • Enables aggressive group_offload to fit large models on consumer GPUs.

Option 2: High Precision (Diffusers/BF16)

Use this version if you have ample VRAM (e.g., 24GB+). Set use_gguf = False in the script to load the model using the standard from_pretrained directory structure for full BFloat16 precision.

🎨 Inpainting Guide

The infer_inpaint.py script leverages a powerful, unified inpainting system with multiple modes controlled by the inpaint_mode parameter.

Preparing Your Mask

For best results, especially when removing objects or dealing with complex edges, it's recommended to pre-process your mask. We provide a utility script for this.

prepare_mask.py This script expands the white areas of your mask and applies a feather (blur) to the edges. This helps to completely cover artifacts from the old image and ensures a smooth, seamless blend with the new generated content.

Usage:

python prepare_mask.py <input_mask_path> <output_mask_path> --expand 15 --feather 10
  • --expand: Expands the mask to cover "ghosting".
  • --feather: Creates a soft gradient for seamless blending.

Inpainting Modes in infer_inpaint.py

You can choose the inpainting method by setting the inpaint_mode variable in the script:

  1. inpaint_mode = "default"

    • Uses the standard ControlNet-based inpainting. Good for general-purpose tasks.
  2. inpaint_mode = "diff"

    • Uses the "Differential Diffusion" inpainting technique. This method is excellent for preserving the original background texture and lighting perfectly while generating new content in the masked area. It works by composing latents at each step of the diffusion process.
  3. inpaint_mode = "diff+inpaint"

    • Combines both methods. It uses the diff mode for background preservation while also feeding the inpainting context to the ControlNet layers. This can be useful for complex scenes where both structural guidance and texture preservation are needed.

🛠️ Model Features & Configuration (V2)

Original Features

  • This ControlNet is added on 15 layer blocks and 2 refiner layer blocks.
  • The model was trained from scratch for 70,000 steps on a dataset of 1 million high-quality images.
  • Multiple Control Conditions Supports Canny, HED, Depth, Pose, and MLSD, which can be used like a standard ControlNet.
  • You can adjust controlnet_conditioning_scale for stronger control. For better stability, we highly recommend using a detailed prompt. The optimal range for controlnet_conditioning_scale is from 0.65 to 0.90.
    • Note on Steps: As you increase the control strength, it's recommended to appropriately increase the number of inference steps to achieve better results.

This optmized V2 model introduces several new features and parameters for enhanced control and flexibility:

  • Unified Pipeline: A single pipeline now handles Text-to-Image, Image-to-Image, ControlNet, and and multiple Inpainting modes.
  • Refiner Scale (controlnet_refiner_conditioning_scale): It provides fine-grained control over the influence of the initial refining layers, allowing for isolated adjustments without the influence of the controlnet's conditioning force.
  • Optional Refiner (add_control_noise_refiner=False): You can now disable the control noise refiner layers when loading the model to save memory or for different stylistic results.
  • Inpainting Blur (mask_blur_radius): A parameter to soften the edges of the inpainting mask for smoother transitions.
  • Backward Compatibility: The model supports running weights from V1.
  • Group Offload Fixes: The underlying code includes crucial fixes to ensure diffusers group_offload works correctly with use_stream=True, enabling efficient memory management without errors.

🏞️ V2 Examples: Refiner Scale Test

The new controlnet_refiner_conditioning_scale parameter allows for fine-tuning the control signal. Here is a comparison showing its effect while keeping the main control scale fixed.

Prompt: "Photorealistic portrait of a beautiful young East Asian woman with long, vibrant purple hair and a black bow. She is wearing a flowing white summer dress, standing on a sunny beach with a sparkling ocean and clear blue sky in the background. Bright natural sunlight, sharp focus, ultra-detailed." Control Image: Pose.

controlnet_conditioning_scale=0.75, num_steps=25Refiner: OffRefiner Scale: 0.75Refiner Scale: 1.0Refiner Scale: 1.5Refiner Scale: 2.0
Output

New Tests with this pipeline

T2I and I2I Results

Original Scale Test Results

The table below shows the generation results under different combinations of Diffusion steps and Control Scale strength from the original model:

Diffusion StepsScale 0.65Scale 0.70Scale 0.75Scale 0.8Scale 0.9Scale 1.0
9
10
20
30
40

📂 Repository Structure

  • ./transformer/: Directory for model weights (GGUF or standard).
  • infer_controlnet.py: Script for ControlNet inference.
  • infer_inpaint.py: Script for inpainting inference.
  • infer_t2i.py: Script for Text-to-Image inference.
  • infer_i2i.py: Script for Image-to-Image inference.
  • prepare_mask.py: Utility script to process masks for inpainting.
  • diffusers_local/: Custom pipeline code.
  • requirements.txt: Python dependencies.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

Класс diffusers.ZImageControlTransformer2DModel для компонента transformer недоступен в образе рантайма.

Ревизия весов
73ac014

0 моделей