Skip to content

models stabilityai stable diffusion 2 1

github-actions[bot] edited this page Oct 21, 2023 · 24 revisions

stabilityai-stable-diffusion-2-1

Overview

Description: stabilityai/stable-diffusion-2-1 model is a fine-tuned version of the Stable Diffusion v2 model, with additional training steps on the same dataset. It's designed for generating and modifying images based on text prompts, utilizing a Latent Diffusion Model with a fixed, pretrained text encoder (OpenCLIP-ViT/H). The model was trained on the LAION-5B dataset and its subsets, with further filtering using LAION's NSFW detector with a conservative "p_unsafe" score of 0.1. The model has various applications in research, art, education, and creative tools. However, there are strict guidelines for the model's use to prevent misuse and malicious activities. It should not be used to create harmful, offensive, or discriminatory content. Additionally, the model has limitations, such as difficulties with photorealism, rendering legible text, and generating complex compositions. The model was primarily trained on English descriptions, potentially leading to biases and limited effectiveness with non-English prompts. To enhance safety, a Safety Checker is recommended for use with this model. > The above summary was generated using ChatGPT. Review the original-model-card to understand the data used to train the model, evaluation metrics, license, intended uses, limitations and bias before using the model. ### Inference samples Inference type|Python sample (Notebook)|CLI with YAML |--|--|--| Real time|text-to-image-online-endpoint.ipynb|text-to-image-online-endpoint.sh Batch |text-to-image-batch-endpoint.ipynb|text-to-image-batch-endpoint.sh

Inference with <a href="https://learn.microsoft.com/en-us/azure/ai-services/content-safety/studio-quickstart", target="_blank">Azure AI Content Safety (AACS) samples

Inference type|Python sample (Notebook) |--|--| Real time|safe-text-to-image-online-deployment.ipynb Batch |safe-text-to-image-batch-endpoint.ipynb ### Sample inputs and outputs (for real-time inference) #### Sample input json { "input_data": { "columns": ["prompt"], "data": ["a photograph of an astronaut riding a horse"], "index": [0] } } #### Sample output json [ { "prompt": "a photograph of an astronaut riding a horse", "generated_image": "image", "nsfw_content_detected": null } ] > Note: > > - "image" string is in base64 format. > - The stabilityai-stable-diffusion-2-1 model doesn't check for the NSFW content in generated image. We highly recommend to use the model with Azure AI Content Safety (AACS). Please refer sample online and batch notebooks for AACS integrated deployments. #### Model inference: visualization for the prompt - "a photograph of an astronaut riding a horse" stabilityai_stable_diffusion_2_1 visualization

Version: 4

Tags

Preview license : creativeml-openrail++-m task : text-to-image

View in Studio: https://ml.azure.com/registries/azureml/models/stabilityai-stable-diffusion-2-1/version/4

License: creativeml-openrail++-m

Properties

SHA: 5cae40e6a2745ae2b01ad92ae5043f95f23644d6

datasets: LAION-5B

inference-min-sku-spec: 4|1|28|176

inference-recommended-sku: Standard_NC6s_v3, Standard_NC12s_v3, Standard_NC24s_v3, Standard_NC24rs_v3, Standard_NC16as_T4_v3, Standard_NC24ads_A100_v4, Standard_NC48ads_A100_v4, Standard_NC4as_T4_v3, Standard_NC64as_T4_v3, Standard_NC8as_T4_v3, Standard_NC96ads_A100_v4, Standard_ND40rs_v2, Standard_ND96amsr_A100_v4, Standard_ND96asr_v4

model_id: stabilityai/stable-diffusion-2-1

Clone this wiki locally