|
| 1 | +--- |
| 2 | +title: How to deploy Stability AI family of models with AI Foundry |
| 3 | +titleSuffix: Azure AI Foundry |
| 4 | +description: How to deploy Stability AI family of models with AI Foundry |
| 5 | +manager: scottpolly |
| 6 | +ms.service: azure-machine-learning |
| 7 | +ms.topic: how-to |
| 8 | +ms.date: 01/23/2025 |
| 9 | +ms.author: timanghn |
| 10 | +author: tinaem |
| 11 | +ms.reviewer: ssalgado |
| 12 | +reviewer: ssalgadodev |
| 13 | +ms.custom: references_regions |
| 14 | +--- |
| 15 | + |
| 16 | +# How to deploy Stability AI family of models with AI Foundry |
| 17 | + |
| 18 | +[!INCLUDE [feature-preview](../includes/feature-preview.md)] |
| 19 | + |
| 20 | +In this article, you learn how to use Azure AI Foundry to deploy Stability AI collection of models as a serverless API with pay-as-you-go billing. |
| 21 | + |
| 22 | +The Stability AI collection of models include Stable Image Core, Stable Image Ultra and Stable Diffusion 3.5 Large. |
| 23 | + |
| 24 | +### Stable Diffusion 3.5 Large |
| 25 | + |
| 26 | +At 8.1 billion parameters, with superior quality and prompt adherence, this base model is the most powerful in the Stable Diffusion family and is ideal for professional use cases at 1 megapixel resolution. |
| 27 | + |
| 28 | +Stable Diffusion 3.5 large supports text and image prompt inputs for image generations. |
| 29 | + |
| 30 | +### Stable Image Core |
| 31 | + |
| 32 | +Leveraging an enhanced version of SDXL, Stable Image Core, delivers exceptional speed and efficiency while maintaining the high-quality output synonymous with Stable Diffusion models. |
| 33 | + |
| 34 | +Stable Image Core supports text prompt inputs only for image generations. |
| 35 | + |
| 36 | +### Stable Image Ultra |
| 37 | + |
| 38 | +Powered by the advanced capabilities of Stable Diffusion 3.5 Large, Stable Image Ultra sets a new standard in photorealism. Stable Image Ultra is ideal for product imagery in marketing and advertising. It also excels in typography, dynamic lighting, and vibrant color rendering. |
| 39 | + |
| 40 | +Stable Image Ultra supports text prompt inputs only for image generations. |
| 41 | + |
| 42 | +[!INCLUDE [models-preview](../includes/models-preview.md)] |
| 43 | + |
| 44 | + |
| 45 | +## Deploy a Stability AI model as a serverless API |
| 46 | + |
| 47 | +Stability AI models in the model catalog can be deployed as a serverless API with pay-as-you-go billing, providing a way to consume them as an API without hosting them on your subscription, while keeping the enterprise security and compliance organizations need. This deployment option doesn't require quota from your subscription. |
| 48 | + |
| 49 | + |
| 50 | +### Prerequisites |
| 51 | + |
| 52 | +To use Stability AI models with Azure AI Foundry, you need the following prerequisites: |
| 53 | + |
| 54 | +### A model deployment |
| 55 | + |
| 56 | +**Deployment to serverless APIs** |
| 57 | + |
| 58 | +Stability AI models can be deployed to serverless API endpoints with pay-as-you-go billing. This kind of deployment provides a way to consume models as an API without hosting them on your subscription, while keeping the enterprise security and compliance that organizations need. |
| 59 | + |
| 60 | +Deployment to a serverless API endpoint doesn't require quota from your subscription. If your model isn't deployed already, use the Azure AI Foundry portal, Azure Machine Learning SDK for Python, the Azure CLI, or ARM templates to [deploy the model as a serverless API](deploy-models-serverless.md). |
| 61 | + |
| 62 | +> [!div class="nextstepaction"] |
| 63 | +> [Deploy the model to serverless API endpoints](deploy-models-serverless.md) |
| 64 | +
|
| 65 | +### Consume Stability AI models as a serverless API |
| 66 | + |
| 67 | +1. In the **workspace**, select **Endpoints** > **Serverless endpoints**. |
| 68 | +1. Find and select the `Stable Diffusion 3.5 Large` deployment you created. |
| 69 | +1. Copy the **Target** URL and the **Key** token values. |
| 70 | +1. Make an API request based on the type of model you deployed. To see an example request, see the [reference section](#reference-for-stability-ai-models-deployed-as-a-serverless-api). |
| 71 | + |
| 72 | +## Reference for Stability AI models deployed as a serverless API |
| 73 | + |
| 74 | +Stability AI models on Models as a Service implement the [Azure AI Model Inference API](../reference/reference-model-inference-api.md) on the route `/image/generations` |
| 75 | + |
| 76 | +#### Request example |
| 77 | + |
| 78 | +``` |
| 79 | +{ |
| 80 | + "prompt": "A photo of a cat", |
| 81 | + "negative_prompt": "A photo of a dog", |
| 82 | + "image_prompt": { |
| 83 | + "image": "puqkvvlvgcjyzughesnkena", |
| 84 | + "strength": 1 |
| 85 | + }, |
| 86 | + "size": "1024x1024", |
| 87 | + "output_format": "png", |
| 88 | + "seed": 26 |
| 89 | +} |
| 90 | +``` |
| 91 | + |
| 92 | +#### Response |
| 93 | + |
| 94 | +``` |
| 95 | +{ |
| 96 | + "image": "iVBORw0KGgoAAAANSUhEUgAABgA...", |
| 97 | + "created": 1739161682 |
| 98 | +} |
| 99 | +``` |
| 100 | + |
| 101 | +Follow this link for a full encoded [image generation response](https://github.com/MicrosoftDocs/azure-ai-docs-pr/pull/2896/$0). |
| 102 | + |
| 103 | +## Cost and quotas |
| 104 | + |
| 105 | +### Cost and quota considerations for Stability AI models deployed as a serverless API |
| 106 | + |
| 107 | +The Stability AI models are deployed as a serverless API and is offered by Stability AI through Azure Marketplace and integrated with AI Foundry for use. You can find Azure Marketplace pricing when deploying or fine-tuning models. |
| 108 | + |
| 109 | +Each time a workspace subscribes to a given model offering from Azure Marketplace, a new resource is created to track the costs associated with its consumption. The same resource is used to track costs associated with inference and fine-tuning; however, multiple meters are available to track each scenario independently. |
| 110 | + |
| 111 | +For more information on how to track costs, see [Monitor costs for models offered through the Azure Marketplace](./costs-plan-manage.md#monitor-costs-for-models-offered-through-the-azure-marketplace). |
| 112 | + |
| 113 | +Quota is managed per deployment. Each deployment has a rate limit of 200,000 tokens per minute and 1,000 API requests per minute. However, we currently limit one deployment per model per project. Contact Microsoft Azure Support if the current rate limits aren't sufficient for your scenarios. |
| 114 | + |
| 115 | +## Content filtering |
| 116 | + |
| 117 | +Models deployed as a serverless API are protected by Azure AI content safety. When deployed to managed compute, you can opt out of this capability. With Azure AI content safety enabled, both the prompt and completion pass through an ensemble of classification models aimed at detecting and preventing the output of harmful content. The content filtering (preview) system detects and takes action on specific categories of potentially harmful content in both input prompts and output completions. Learn more about [Azure AI Content Safety](/azure/ai-services/content-safety/overview). |
| 118 | + |
| 119 | +## Related content |
| 120 | + |
| 121 | +- [Model Catalog and Collections](../concepts/concept-model-catalog.md) |
| 122 | +- [Plan and manage costs for Azure AI Foundry](./costs-plan-manage.md) |
| 123 | +- [Region availability for models in serverless API endpoints](../concepts/concept-endpoint-serverless-availability.md) |
0 commit comments