/ Модель

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

Лицензия
Своя лицензия
Базовая модель
FLUX.1-dev-ControlNet-Union-Pro-2.0
Библиотека
diffusers
Опубликована
19 апр 2025

FLUX.1-dev-ControlNet-Union-Pro-2.0-fp8

Генерация изображений3 профессии

FLUX.1-dev-ControlNet-Union-Pro-2.0-fp8 — это FP8-квантизованная версия модели Shakker-Labs/FLUX.1-dev-ControlNet-Union-Pro-2.0, опубликованная пользователем ABDALLALSWAITI.

3 643скачиваний за 30 дней59лайковвеса обновлены19 апр 2025

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

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

Модель предназначена для генерации изображений по текстовому описанию с управлением структурой изображения через ControlNet и используется в библиотеке Diffusers совместно с базовой моделью black-forest-labs/FLUX.1-dev. Это не дообученная версия, а прямая квантизация исходной модели из BFloat16 в формат FP8 E4M3 с помощью встроенной поддержки FP8 в PyTorch.

Модель поддерживает несколько режимов управления: canny, soft edge, depth, pose и gray, а также совместное использование с другими ControlNet. По сравнению с FLUX.1-dev-ControlNet-Union-Pro она не использует mode embedding, лучше работает с canny и pose, поддерживает soft edge и не поддерживает tile. Архитектура ControlNet включает 6 double blocks и 0 single blocks. Исходная модель обучалась с нуля на 20 миллионах качественных изображений общего назначения и изображений людей при разрешении 512×512; в карточке также указано, что для обучения использовались 300 тысяч шагов и BFloat16.

Ключевое преимущество версии FP8 — примерно на 50% меньший размер по сравнению с BFloat16 или FP16, потенциально более низкое потребление памяти и ускорение инференса на совместимом оборудовании при заявленной минимальной потере качества. Ограничения связаны с необходимостью поддержки FP8 и CUDA-окружения, а также с тем, что модель является компонентом ControlNet и требует базовой FLUX.1-dev для генерации. В метаданных указан английский язык. Лицензия — flux-1-dev-non-commercial-license; коммерческое использование регулируется условиями этой лицензии.

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

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

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

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

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

Открыть на Hugging Face

FLUX.1-dev-ControlNet-Union-Pro-2.0 (FP8 Quantized)

This repository contains an FP8 quantized version of the Shakker-Labs/FLUX.1-dev-ControlNet-Union-Pro-2.0 model. This is NOT a fine-tuned model but a direct quantization of the original BFloat16 model to FP8 format for optimized inference performance. We provide an online demo.

Quantization Details

This model has been quantized from the original BFloat16 format to FP8 format using PyTorch's native FP8 support. Here are the specifics:

  • Quantization Technique: Native FP8 quantization
  • Precision: E4M3 format (4 bits for exponent, 3 bits for mantissa)
  • Library Used: PyTorch's built-in FP8 support
  • Data Type: torch.float8_e4m3fn
  • Original Model: BFloat16 format (Shakker-Labs/FLUX.1-dev-ControlNet-Union-Pro-2.0)
  • Model Size Reduction: ~50% smaller than the original model

The benefits of FP8 quantization include:

  • Reduced Memory Usage: Approximately 50% smaller model size compared to BFloat16/FP16
  • Faster Inference: Potential speed improvements, especially on hardware with FP8 support
  • Minimal Quality Loss: Carefully calibrated quantization process to preserve output quality

Important Note: This is a direct quantization of Shakker-Labs/FLUX.1-dev-ControlNet-Union-Pro-2.0 and preserves all the functionality of the original model. No fine-tuning or additional training has been performed.

Keynotes

In comparison with Shakker-Labs/FLUX.1-dev-ControlNet-Union-Pro,

  • Remove mode embedding, has smaller model size.
  • Improve on canny and pose, better control and aesthetics.
  • Add support for soft edge. Remove support for tile.

Model Cards

  • This ControlNet consists of 6 double blocks and 0 single block. Mode embedding is removed.
  • We train the model from scratch for 300k steps using a dataset of 20M high-quality general and human images. We train at 512x512 resolution in BFloat16, batch size = 128, learning rate = 2e-5, the guidance is uniformly sampled from [1, 7]. We set the text drop ratio to 0.20.
  • This model supports multiple control modes, including canny, soft edge, depth, pose, gray. You can use it just as a normal ControlNet.
  • This model can be jointly used with other ControlNets.

Showcases

Inference

import torch
from diffusers.utils import load_image
from diffusers import FluxControlNetPipeline, FluxControlNetModel

base_model = 'black-forest-labs/FLUX.1-dev'
controlnet_model_union_fp8 = 'ABDALLALSWAITI/FLUX.1-dev-ControlNet-Union-Pro-2.0-fp8'

# Load using FP8 data type
controlnet = FluxControlNetModel.from_pretrained(controlnet_model_union_fp8, torch_dtype=torch.float8_e4m3fn)
pipe = FluxControlNetPipeline.from_pretrained(base_model, controlnet=controlnet, torch_dtype=torch.bfloat16)
pipe.to("cuda")

# replace with other conds
control_image = load_image("./conds/canny.png")
width, height = control_image.size

prompt = "A young girl stands gracefully at the edge of a serene beach, her long, flowing hair gently tousled by the sea breeze. She wears a soft, pastel-colored dress that complements the tranquil blues and greens of the coastal scenery. The golden hues of the setting sun cast a warm glow on her face, highlighting her serene expression. The background features a vast, azure ocean with gentle waves lapping at the shore, surrounded by distant cliffs and a clear, cloudless sky. The composition emphasizes the girl's serene presence amidst the natural beauty, with a balanced blend of warm and cool tones."

image = pipe(
    prompt, 
    control_image=control_image,
    width=width,
    height=height,
    controlnet_conditioning_scale=0.7,
    control_guidance_end=0.8,
    num_inference_steps=30, 
    guidance_scale=3.5,
    generator=torch.Generator(device="cuda").manual_seed(42),
).images[0]

Multi-Inference

import torch
from diffusers.utils import load_image

# use local files for this moment
from pipeline_flux_controlnet import FluxControlNetPipeline
from controlnet_flux import FluxControlNetModel

base_model = 'black-forest-labs/FLUX.1-dev'
controlnet_model_union_fp8 = 'ABDALLALSWAITI/FLUX.1-dev-ControlNet-Union-Pro-2.0-fp8'

# Load using FP8 data type
controlnet = FluxControlNetModel.from_pretrained(controlnet_model_union_fp8, torch_dtype=torch.float8_e4m3fn)
pipe = FluxControlNetPipeline.from_pretrained(base_model, controlnet=[controlnet], torch_dtype=torch.bfloat16) # use [] to enable multi-CNs
pipe.to("cuda")

# replace with other conds
control_image = load_image("./conds/canny.png")
width, height = control_image.size

prompt = "A young girl stands gracefully at the edge of a serene beach, her long, flowing hair gently tousled by the sea breeze. She wears a soft, pastel-colored dress that complements the tranquil blues and greens of the coastal scenery. The golden hues of the setting sun cast a warm glow on her face, highlighting her serene expression. The background features a vast, azure ocean with gentle waves lapping at the shore, surrounded by distant cliffs and a clear, cloudless sky. The composition emphasizes the girl's serene presence amidst the natural beauty, with a balanced blend of warm and cool tones."

image = pipe(
    prompt, 
    control_image=[control_image, control_image], # try with different conds such as canny&depth, pose&depth
    width=width,
    height=height,
    controlnet_conditioning_scale=[0.35, 0.35],
    control_guidance_end=[0.8, 0.8],
    num_inference_steps=30, 
    guidance_scale=3.5,
    generator=torch.Generator(device="cuda").manual_seed(42),
).images[0]

Recommended Parameters

You can adjust controlnet_conditioning_scale and control_guidance_end for stronger control and better detail preservation. For better stability, we highly suggest to use detailed prompt, for some cases, multi-conditions help.

  • Canny: use cv2.Canny, controlnet_conditioning_scale=0.7, control_guidance_end=0.8.
  • Soft Edge: use AnylineDetector, controlnet_conditioning_scale=0.7, control_guidance_end=0.8.
  • Depth: use depth-anything, controlnet_conditioning_scale=0.8, control_guidance_end=0.8.
  • Pose: use DWPose, controlnet_conditioning_scale=0.9, control_guidance_end=0.65.
  • Gray: use cv2.cvtColor, controlnet_conditioning_scale=0.9, control_guidance_end=0.8.

Using FP8 Model

This repository includes the FP8 quantized version of the model. To use it, you'll need PyTorch with FP8 support:

import torch
from diffusers.utils import load_image
from diffusers import FluxControlNetPipeline, FluxControlNetModel

base_model = 'black-forest-labs/FLUX.1-dev'
controlnet_model_union_fp8 = 'ABDALLALSWAITI/FLUX.1-dev-ControlNet-Union-Pro-2.0-fp8'

# Load using FP8 data type
controlnet = FluxControlNetModel.from_pretrained(controlnet_model_union_fp8, torch_dtype=torch.float8_e4m3fn)
pipe = FluxControlNetPipeline.from_pretrained(base_model, controlnet=controlnet, torch_dtype=torch.bfloat16)
pipe.to("cuda")

# The rest of the code is the same as with the original model

See fp8_inference_example.py for a complete example.

Resources

Acknowledgements

This model is developed by Shakker Labs. The original idea is inspired by xinsir/controlnet-union-sdxl-1.0. All copyright reserved.

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

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

GPU в ailist

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

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

Готовая квантизация поддерживается только для текстовых LLM (vLLM).

Ревизия весов
4d157d7

0 моделей