SaladCloud Blog

INSIDE SALAD

Civitai powers 10 Million AI images per day with Salad’s distributed cloud

Salad Technologies

Civitai: The Home of Open-Source Generative AI

“Our mission is rooted in the belief that AI resources should be accessible to all, not monopolized by a few” –  Justin Maier, Founder & CEO of Civitiai.

With an average of 26 Million visits per month, 10 Million users & more than 200,000 open-source models & embeddings, Civitai is definitely fulfilling their mission of making AI accessible to all.
Launched in November 2022, Civitai is one of the largest generative AI communities in the world today helping users discover, create & share open-source, AI-generated media content easily. In Sep 2023, Civitai launched their Image Generator, a web-based interface for Stable Diffusion & one of the most used products on the platform today. This product allows users to input text prompts and receive image outputs. All the processing is handled by Civitai, requiring hundreds of Stable Diffusion appropriate GPUs on the cloud.

The Civitai platform, one of the most visited Generative AI communities today. 

Civitai’s challenge: Growing compute at scale without breaking the bank

Civitai’s explosive growth, focus on GPU-hungry AI-generated media & the new image generator brought about big infrastructure challenges:

  • How to access hundreds of GPUs in the middle of a global GPU shortage?
  • How to manage hundreds of GPUs to account for the fluctuations in demand?
  • How to cost-effectively handle millions of unique model combinations & users?

Continuing with their current infrastructure provider and high-end GPUs would mean an exorbitant cloud bill, not to mention the scarcity of high-end GPUs.

Democratized AI-media creation meets democratized computing on Salad

To solve these challenges, Civitai partnered with Salad, a distributed cloud for AI/ML inference at scale.

Like Civitai, Salad’s mission also lies in democratization – of cloud computing. SaladCloud is a fully people-powered cloud with 1 Million+ contributors on the network and 10K+ GPUs at any time. With over 100 Million consumer GPUs in the world lying unused for 18-22 hrs a day, Salad is on a mission to activate the largest pool of compute in the world for the lowest cost. Every day, thousands of voluntary contributors securely share compute resources with businesses like Civitai in exchange for rewards & gift cards.

“For the past few months, Civitai has been at the forefront of Salad’s ambitious project, utilizing Salad’s distributed network of GPUs to power our on-site image generator. This partnership is more than just a technical alliance; it’s a testament to what we can achieve when we harness the power of community, democratization and shared goals”, says Chris Adler, Head of Partnerships at Civitai. Civitai’s partnership with Salad helped manage the scale & cost of their inference while supporting millions of users and model combinations on Salad’s unique distributed infrastructure.

“By switching to Salad, Civitai is now serving inference on over 600 consumer GPUs to deliver 10 Million images per day and training more than 15,000 LoRAs per month”

– Justin Maier, Civitai

Scaling to hundreds of affordable GPUs on Salad

Running Stable Diffusion at scale requires access to and effectively managing hundreds of GPUs, especially in the midst of a GPU-shortage. Also important is understanding the desired throughput to determine capacity needs and estimated operating cost for any infrastructure provider.

As discussed in this blog, expensive, high-end GPUs like the A100 & H100 are perfect for training but when serving AI inference at scale for use cases like text-to-image, the cost-economics break down. You get better cost-performance on consumer-grade GPUs generating 4X-8X more images per dollar compared to AI-focused GPUs. With Salad’s network of thousands of Stable Diffusion compatible consumer GPUs, Civitai had access to the most cost effective GPUs, ready to keep up with the demands of its growing user base.

GPU comparison for Stable Diffusion showing images/$ across different GPUs

Managing Hundreds of GPUs

As Civitai’s Stable Diffusion deployment scaled, manually managing each individual instance wasn’t an option. Salad’s Solutions Team worked with Civitai to design an automated approach that can respond to changes in GPU demand and reduce the risk of human error.

By leveraging our fully-managed container service, Civitai ensures that each and every instance of their application will run and perform consistently, providing a reliable, repeatable, and scalable environment for their production workloads. When demand changes, Civitai can simply scale up or down the number of replicas using the portal or our public API, further automating the deployment.

Using Salad’s public API, Civitai monitors model usage and analyzes the queues, customizing their auto scaling rules to optimize both performance and cost.

“Salad not only had the lowest prices in the market for image generation but also offered us incredible scalability. When we needed 200+ GPUs due to a surge in demand, Salad easily met that demand. Plus their technical support has been outstanding”

– Justin Maier, Civitai

Supporting Millions of unique model combinations on Salad at low cost

Civitai’s image generation product supports millions of unique combinations of checkpoints, Low-Rank Adaptations (LoRAs), Variational Autoencoders (VAEs), and Textual Inversions. Users often combine these into a single image generation request.

In order to efficiently manage these models on SaladCloud, Civitai combines a robust set of APIs and business logic with a custom container designed to respond dynamically to the image generation demands of their community.

At its core, the Civitai image generation product is built around connecting queues with a custom Stable Diffusion container on Salad. This allows the system to gracefully handle surges in image generation requests and millions of unique combinations of models.

Civitai’s process on Salad to handle incoming image generation requests

Each container includes a Python Worker that communicates with Civitai’s Orchestrator. The Worker application is responsible for downloading models, automating image generation with a sequence of calls to a custom image generation pipeline, and uploading resulting images back to Civitai.

Architecture of Civitai container and API
Architecture of Civitai container and API

By building a generic application that is controlled by the Civitai Orchestrator, the overall system automatically responds to the latest trending models and eliminates the need to manually deploy individual models.

If an image generation request is received for a combination of models that are already loaded on one or more nodes, the worker will process that request as soon as the GPU is available. If the request is for a combination of models that are not currently loaded into a worker, the job is queued up until the models are downloaded and loaded, then the job is processed.

Civitai & Salad – A perfect match for democratizing AI

“We chose Salad because we share a common mission: to stop AI resources from being monopolized by a few. Salad’s distributed cloud is providing Gen AI companies like us an alternative to expensive hyperscalers”

– Justin Maier, Founder & CEO of Civitiai.

With this specific workflow built on Salad, Civitai is able to always leverage the best GPU combinations and lowest prices while ensuring their infrastructure scales up/down with incoming requests. Being able to serve these requests on low-cost, consumer GPUs on SaladCloud helps Civitai continue making AI-generated media accessible to all.

Reinforcing this partnership, Civitai users can now sign up on www.salad.com to share their unused GPU compute to power Civitai. In exchange, users get compensated in Buzz, Civitai’s on-site currency. This also opens up access to Civitai for Salad’s current users, offering an exchange of Salad balance to Buzz.

You can read more about Civitai’s Buzz on Salad’s storefront here.

With 4 Million+ registered users on Civitai and 1 Million+ on Salad signing up to share compute, both Civitai and Salad owe their very existence to our respective communities. Adding Buzz to Salad is our way of ensuring that your contributions are recognized and rewarded.


Have questions about SaladCloud for your workload?

Book a 15 min call with our team. Get $50 in testing credits.

Related Blog Posts

Run cog applications on Salad GPU cloud

How to run cog applications on SaladCloud

Introduction to Cog: Containers for Machine Learning Cog is an open-source tool designed to streamline the creation of inference applications for various AI models. It offers CLI tools, Python modules...
Read More
Blend cuts AI inference cost by 85% on SaladCloud running 3X more scale

Blend cuts AI inference cost by 85% on Salad while running 3X more scale

Key takeaways: - The team at Blend were facing high inference costs & scalability challenges on major cloud providers & local vendors- Switching to SaladCloud for image generation helped them...
Read More
AI batch transcription of 1 million hours of video

AI Batch Transcription Benchmark: Transcribing 1 Million+ Hours of Videos in just 7 days for $1800

AI batch transcription benchmark: Speech-to-text at scale Building upon the inference benchmark of Parakeet TDT 1.1B for YouTube videos on SaladCloud and with our ongoing efforts to enhance the system...
Read More

Don’t miss anything!

Subscribe To SaladCloud Newsletter & Stay Updated.