/ Модель

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

Лицензия
Apache 2.0
Библиотека
diffusers
Опубликована
19 окт 2023

SSD-1B

Генерация изображенийТекст → изображение4 профессии

SSD-1B — ускоренная диффузионная модель Segmind для генерации изображений по текстовым описаниям.

15 538скачиваний за 30 дней842лайкавеса обновлены8 янв 2024

Бенчмарки

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

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Изображения» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели сгенерируют результат по каждой задаче. Опубликованный тест появится на этой странице.

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

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

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

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

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

SSD-1B — модель генерации изображений по текстовому описанию, разработанная Segmind. Это диффузионная модель на 1,3 млрд параметров, созданная дистилляцией Stable Diffusion XL: из базовой модели удалили часть слоёв, чтобы сократить размер примерно на 50% и ускорить генерацию до 60% по сравнению с SDXL. В дистилляции использовались знания SDXL, ZavyChromaXL и JuggernautXL; модель обучалась на наборах данных GRIT и очищенных данных Midjourney.

Модель предназначена для создания изображений по текстовым промптам в творческих, образовательных и исследовательских сценариях. Работает через библиотеку Diffusers и поддерживает несколько разрешений, включая квадратные и портретные или альбомные форматы вплоть до 1536 пикселей по одной стороне. Основной язык промптов в карточке не указан.

Модель может испытывать трудности с фотореалистичными изображениями людей, разборчивым текстом и сложными композициями; результаты могут отражать смещения обучающих данных. Она не подходит для создания точных фактических изображений людей, событий и реального мира. Лицензия — Apache 2.0.

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

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

Ограничения

Модель может хуже передавать фотореалистичных людей, разборчивый текст и сложные композиции; результаты могут наследовать смещения данных. Не предназначена для точного изображения реальных людей, событий или фактов.

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

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

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

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

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

Открыть на Hugging Face

Segmind Stable Diffusion 1B (SSD-1B) Model Card

image/png

📣 Read our technical report for more details on our disillation method

AUTOMATIC1111 compatibility added. Supporting file here

Demo

Try out the model at Segmind SSD-1B for ⚡ fastest inference. You can also try it on 🤗 Spaces

Model Description

The Segmind Stable Diffusion Model (SSD-1B) is a distilled 50% smaller version of the Stable Diffusion XL (SDXL), offering a 60% speedup while maintaining high-quality text-to-image generation capabilities. It has been trained on diverse datasets, including Grit and Midjourney scrape data, to enhance its ability to create a wide range of visual content based on textual prompts.

This model employs a knowledge distillation strategy, where it leverages the teachings of several expert models in succession, including SDXL, ZavyChromaXL, and JuggernautXL, to combine their strengths and produce impressive visual outputs.

Special thanks to the HF team 🤗 especially Sayak, Patrick and Poli for their collaboration and guidance on this work.

Image Comparision (SDXL-1.0 vs SSD-1B)

image/png

Usage:

This model can be used via the 🧨 Diffusers library.

Make sure to install diffusers from source by running

pip install git+https://github.com/huggingface/diffusers

In addition, please install transformers, safetensors and accelerate:

pip install transformers accelerate safetensors

To use the model, you can run the following:

from diffusers import StableDiffusionXLPipeline
import torch
pipe = StableDiffusionXLPipeline.from_pretrained("segmind/SSD-1B", torch_dtype=torch.float16, use_safetensors=True, variant="fp16")
pipe.to("cuda")
# if using torch < 2.0
# pipe.enable_xformers_memory_efficient_attention()
prompt = "An astronaut riding a green horse" # Your prompt here
neg_prompt = "ugly, blurry, poor quality" # Negative prompt here
image = pipe(prompt=prompt, negative_prompt=neg_prompt).images[0]

Update: Our model should now be usable in ComfyUI.

Please do use negative prompting, and a CFG around 9.0 for the best quality!

Model Description

Key Features

  • Text-to-Image Generation: The model excels at generating images from text prompts, enabling a wide range of creative applications.

  • Distilled for Speed: Designed for efficiency, this model offers a 60% speedup, making it a practical choice for real-time applications and scenarios where rapid image generation is essential.

  • Diverse Training Data: Trained on diverse datasets, the model can handle a variety of textual prompts and generate corresponding images effectively.

  • Knowledge Distillation: By distilling knowledge from multiple expert models, the Segmind Stable Diffusion Model combines their strengths and minimizes their limitations, resulting in improved performance.

Model Architecture

The SSD-1B Model is a 1.3B Parameter Model which has several layers removed from the Base SDXL Model

image/png

Training info

These are the key hyperparameters used during training:

  • Steps: 251000
  • Learning rate: 1e-5
  • Batch size: 32
  • Gradient accumulation steps: 4
  • Image resolution: 1024
  • Mixed-precision: fp16

Multi-Resolution Support

image/jpeg

SSD-1B can support the following output resolutions.

  • 1024 x 1024 (1:1 Square)
  • 1152 x 896 (9:7)
  • 896 x 1152 (7:9)
  • 1216 x 832 (19:13)
  • 832 x 1216 (13:19)
  • 1344 x 768 (7:4 Horizontal)
  • 768 x 1344 (4:7 Vertical)
  • 1536 x 640 (12:5 Horizontal)
  • 640 x 1536 (5:12 Vertical)

Speed Comparision

We have observed that SSD-1B is upto 60% faster than the Base SDXL Model. Below is a comparision on an A100 80GB.

image/png

Below are the speed up metrics on a RTX 4090 GPU.

image/png

Model Sources

For research and development purposes, the SSD-1B Model can be accessed via the Segmind AI platform. For more information and access details, please visit Segmind.

Uses

Direct Use

The Segmind Stable Diffusion Model is suitable for research and practical applications in various domains, including:

  • Art and Design: It can be used to generate artworks, designs, and other creative content, providing inspiration and enhancing the creative process.

  • Education: The model can be applied in educational tools to create visual content for teaching and learning purposes.

  • Research: Researchers can use the model to explore generative models, evaluate its performance, and push the boundaries of text-to-image generation.

  • Safe Content Generation: It offers a safe and controlled way to generate content, reducing the risk of harmful or inappropriate outputs.

  • Bias and Limitation Analysis: Researchers and developers can use the model to probe its limitations and biases, contributing to a better understanding of generative models' behavior.

Downstream Use

The Segmind Stable Diffusion Model can also be used directly with the 🧨 Diffusers library training scripts for further training, including:

export MODEL_NAME="segmind/SSD-1B"
export VAE_NAME="madebyollin/sdxl-vae-fp16-fix"
export DATASET_NAME="lambdalabs/pokemon-blip-captions"

accelerate launch train_text_to_image_lora_sdxl.py \
  --pretrained_model_name_or_path=$MODEL_NAME \
  --pretrained_vae_model_name_or_path=$VAE_NAME \
  --dataset_name=$DATASET_NAME --caption_column="text" \
  --resolution=1024 --random_flip \
  --train_batch_size=1 \
  --num_train_epochs=2 --checkpointing_steps=500 \
  --learning_rate=1e-04 --lr_scheduler="constant" --lr_warmup_steps=0 \
  --mixed_precision="fp16" \
  --seed=42 \
  --output_dir="sd-pokemon-model-lora-ssd" \
  --validation_prompt="cute dragon creature" --report_to="wandb" \
  --push_to_hub
export MODEL_NAME="segmind/SSD-1B"
export VAE_NAME="madebyollin/sdxl-vae-fp16-fix"
export DATASET_NAME="lambdalabs/pokemon-blip-captions"

accelerate launch train_text_to_image_sdxl.py \
  --pretrained_model_name_or_path=$MODEL_NAME \
  --pretrained_vae_model_name_or_path=$VAE_NAME \
  --dataset_name=$DATASET_NAME \
  --enable_xformers_memory_efficient_attention \
  --resolution=512 --center_crop --random_flip \
  --proportion_empty_prompts=0.2 \
  --train_batch_size=1 \
  --gradient_accumulation_steps=4 --gradient_checkpointing \
  --max_train_steps=10000 \
  --use_8bit_adam \
  --learning_rate=1e-06 --lr_scheduler="constant" --lr_warmup_steps=0 \
  --mixed_precision="fp16" \
  --report_to="wandb" \
  --validation_prompt="a cute Sundar Pichai creature" --validation_epochs 5 \
  --checkpointing_steps=5000 \
  --output_dir="ssd-pokemon-model" \
  --push_to_hub
export MODEL_NAME="segmind/SSD-1B"
export INSTANCE_DIR="dog"
export OUTPUT_DIR="lora-trained-xl"
export VAE_PATH="madebyollin/sdxl-vae-fp16-fix"

accelerate launch train_dreambooth_lora_sdxl.py \
  --pretrained_model_name_or_path=$MODEL_NAME  \
  --instance_data_dir=$INSTANCE_DIR \
  --pretrained_vae_model_name_or_path=$VAE_PATH \
  --output_dir=$OUTPUT_DIR \
  --mixed_precision="fp16" \
  --instance_prompt="a photo of sks dog" \
  --resolution=1024 \
  --train_batch_size=1 \
  --gradient_accumulation_steps=4 \
  --learning_rate=1e-5 \
  --report_to="wandb" \
  --lr_scheduler="constant" \
  --lr_warmup_steps=0 \
  --max_train_steps=500 \
  --validation_prompt="A photo of sks dog in a bucket" \
  --validation_epochs=25 \
  --seed="0" \
  --push_to_hub

Out-of-Scope Use

The SSD-1B Model is not suitable for creating factual or accurate representations of people, events, or real-world information. It is not intended for tasks requiring high precision and accuracy.

Limitations and Bias

Limitations & Bias The SSD-1B Model has some challenges in embodying absolute photorealism, especially in human depictions. While it grapples with incorporating clear text and maintaining the fidelity of complex compositions due to its autoencoding approach, these hurdles pave the way for future enhancements. Importantly, the model's exposure to a diverse dataset, though not a panacea for ingrained societal and digital biases, represents a foundational step towards more equitable technology. Users are encouraged to interact with this pioneering tool with an understanding of its current limitations, fostering an environment of conscious engagement and anticipation for its continued evolution.

Citation

@misc{gupta2024progressive,
      title={Progressive Knowledge Distillation Of Stable Diffusion XL Using Layer Level Loss}, 
      author={Yatharth Gupta and Vishnu V. Jaddipal and Harish Prabhala and Sayak Paul and Patrick Von Platen},
      year={2024},
      eprint={2401.02677},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

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

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

GPU в ailist

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

Можно запустить

Подбираем GPU…

Ревизия весов
60987f3

0 моделей