/ Модель

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

Лицензия
MIT
Библиотека
transformers
Опубликована
13 авг 2025

UniPic2-SD3.5M-Kontext-GRPO-2B

Мультимодальная модель4 профессии

Мультимодальная модель Skywork для генерации и редактирования изображений с улучшенным отображением текста.

32скачиваний за 30 дней11лайковвеса обновлены8 сен 2025

Бенчмарки

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

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

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

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

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

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

UniPic2-SD3.5M-Kontext-GRPO-2B — постобученная методом GRPO модель Skywork на базе UniPic2-SD3.5M-Kontext-2B. Она предназначена для генерации изображений по текстовому запросу и редактирования изображений; особое внимание уделено улучшенному отображению текста внутри изображений. Модель описана как быстрая и рассчитанная на запуск на одной потребительской видеокарте с 16 ГБ памяти.

По тегам карточки модель относится к мультимодальным авторегрессионным моделям, объединяющим понимание изображений, редактирование и генерацию. Репозиторий содержит веса в формате safetensors, библиотека — Transformers; лицензия — MIT. README не сообщает поддерживаемые естественные языки и конкретные ограничения качества.

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

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

Ограничения

Для запуска на одном потребительском GPU требуется 16 ГБ памяти. В карточке не приведены подробные сведения о качестве, поддерживаемых языках и ограничениях редактирования.

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

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

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

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

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

Открыть на Hugging Face

🌌 UniPic2-SD3.5M-Kontext-GRPO-2B

📖 Introduction

UniPic2-SD3.5M-Kontext-GRPO-2B is a post-trained grpo version T2I model built on the UniPic2-SD3.5M-Kontext-2B, with enhanced text rendering. It excels at text-to-image generation and image editing, delivering high quality at fast speeds, and runs smoothly on a single 16 GB consumer GPU.

📊 Benchmarks

🧠 Usage

1. Clone the Repository

git clone https://github.com/SkyworkAI/UniPic
cd UniPic-2

2. Set Up the Environment

conda create -n unipic python=3.10
conda activate unipic
pip install -r requirements.txt

3.Text-to-Image Generation

import torch
from PIL import Image
from unipicv2.pipeline_stable_diffusion_3_kontext import StableDiffusion3KontextPipeline
from unipicv2.transformer_sd3_kontext import SD3Transformer2DKontextModel
from diffusers import FlowMatchEulerDiscreteScheduler, AutoencoderKL
from transformers import CLIPTextModelWithProjection, CLIPTokenizer, T5EncoderModel, T5TokenizerFast

# Load model components
pretrained_model_name_or_path = "Skywork/UniPic2-SD3.5M-Kontext-2B"

transformer = SD3Transformer2DKontextModel.from_pretrained(
        pretrained_model_name_or_path, subfolder="transformer", torch_dtype=torch.bfloat16).cuda()

vae = AutoencoderKL.from_pretrained(
    pretrained_model_name_or_path, subfolder="vae",
    torch_dtype=torch.bfloat16, device_map="auto", low_cpu_mem_usage=True
).cuda()

# Load text encoders
text_encoder = CLIPTextModelWithProjection.from_pretrained(
    pretrained_model_name_or_path, subfolder="text_encoder", torch_dtype=torch.bfloat16, device_map="auto", low_cpu_mem_usage=True
).cuda()
tokenizer = CLIPTokenizer.from_pretrained(pretrained_model_name_or_path, subfolder="tokenizer")

text_encoder_2 = CLIPTextModelWithProjection.from_pretrained(
    pretrained_model_name_or_path, subfolder="text_encoder_2", torch_dtype=torch.bfloat16, device_map="auto", low_cpu_mem_usage=True
).cuda()
tokenizer_2 = CLIPTokenizer.from_pretrained(pretrained_model_name_or_path, subfolder="tokenizer_2")

text_encoder_3 = T5EncoderModel.from_pretrained(
    pretrained_model_name_or_path, subfolder="text_encoder_3", torch_dtype=torch.bfloat16, device_map="auto", low_cpu_mem_usage=True
).cuda()
tokenizer_3 = T5TokenizerFast.from_pretrained(pretrained_model_name_or_path, subfolder="tokenizer_3")

scheduler = FlowMatchEulerDiscreteScheduler.from_pretrained(
    pretrained_model_name_or_path, subfolder="scheduler"
)

# Create pipeline
pipeline = StableDiffusion3KontextPipeline(
    transformer=transformer, vae=vae,
    text_encoder=text_encoder, tokenizer=tokenizer,
    text_encoder_2=text_encoder_2, tokenizer_2=tokenizer_2,
    text_encoder_3=text_encoder_3, tokenizer_3=tokenizer_3,
    scheduler=scheduler)

# Generate image
image = pipeline(
    prompt='a pig with wings and a top hat flying over a happy futuristic scifi city',
    negative_prompt='blurry, low quality, low resolution, distorted, deformed, broken content, missing parts, damaged details, artifacts, glitch, noise, pixelated, grainy, compression artifacts, bad composition, wrong proportion, incomplete editing, unfinished, unedited areas.',
    height=512, width=384,
    num_inference_steps=50,
    guidance_scale=3.5,
    generator=torch.Generator(device=transformer.device).manual_seed(42)
).images[0]

image.save("text2image.png")

4. Image Editing

# Load and preprocess image
def fix_longer_edge(x, image_size, factor=32):
    w, h = x.size
    if w >= h:
        target_w = image_size
        target_h = h * (target_w / w)
        target_h = round(target_h / factor) * factor
    else:
        target_h = image_size
        target_w = w * (target_h / h)
        target_w = round(target_w / factor) * factor
    x = x.resize(size=(target_w, target_h))
    return x

image = Image.open("text2image.png")
image = fix_longer_edge(image, image_size=512)

negative_prompt = "blurry, low quality, low resolution, distorted, deformed, broken content, missing parts, damaged details, artifacts, glitch, noise, pixelated, grainy, compression artifacts, bad composition, wrong proportion, incomplete editing, unfinished, unedited areas."

# Edit image
edited_image = pipeline(
    image=image,
    prompt="remove the pig's hat",
    negative_prompt=negative_prompt,
    height=image.height, width=image.width,
    num_inference_steps=50,
    guidance_scale=3.5,
    generator=torch.Generator(device=transformer.device).manual_seed(42)
).images[0]

edited_image.save("edited_img.png")

📄 License

This model is released under the MIT License.

Citation

If you use Skywork-UniPic in your research, please cite:

@misc{wang2025skyworkunipicunifiedautoregressive,
      title={Skywork UniPic: Unified Autoregressive Modeling for Visual Understanding and Generation}, 
      author={Peiyu Wang and Yi Peng and Yimeng Gan and Liang Hu and Tianyidan Xie and Xiaokun Wang and Yichen Wei and Chuanxin Tang and Bo Zhu and Changshi Li and Hongyang Wei and Eric Li and Xuchen Song and Yang Liu and Yahui Zhou},
      year={2025},
      eprint={2508.03320},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2508.03320}, 
}

@misc{wei2025skyworkunipic20building,
      title={Skywork UniPic 2.0: Building Kontext Model with Online RL for Unified Multimodal Model}, 
      author={Hongyang Wei and Baixin Xu and Hongbo Liu and Cyrus Wu and Jie Liu and Yi Peng and Peiyu Wang and Zexiang Liu and Jingwen He and Yidan Xietian and Chuanxin Tang and Zidong Wang and Yichen Wei and Liang Hu and Boyi Jiang and William Li and Ying He and Yang Liu and Xuchen Song and Eric Li and Yahui Zhou},
      year={2025},
      eprint={2509.04548},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2509.04548}, 
}

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

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

GPU в ailist

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

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

Any-to-any модели пока не поддерживаются.

Ревизия весов
a343d92

0 моделей