File size: 2,001 Bytes
76d9c4f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
title: Stable Diffusion Playground
description: Generate images with a prompt on the web, powered with Stable Diffusion
version: EN
---

## Try out this model on [VESSL Hub](https://vessl.ai/hub).

A simple web app for [stable diffusion](https://stability.ai/) inference is deployed in this example. Some SD model checkpoints are mounted with a VESSL Model so you can try some generation instantly.

Stable diffusion is a deep learning, text-to-image model that uses a diffusion technique, which generates an image from noise by iterating gradual denoising steps. Unlike other text-to-image models, stable diffusion performs a diffusion process in the latent space with smaller dimensions and reconstructs the result to the image in a real dimension. Also, a cross-attention mechanism is added for multi-modal tasks such as text-to-image and layout-to-image tasks.

<img
  className="rounded-md"
  src="/images/sd-webui-grumpy-cat.png"
/>

## Running the model

You can run the model with our quick command.
```sh
vessl run crewate -f sd-webui.yaml
```

Here's a rundown of the `sd-webui.yaml` file.
```yaml
name: stable-diffusion-webui
description: A template Run for stable diffusion webui app
resources:
  cluster: google-oregon
  preset: v1.l4-1.mem-42
image: quay.io/vessl-ai/hub:torch2.1.0-cuda12.2-202312070053
import:
  /code/:
    git:
      url: https://github.com/vessl-ai/hub-model
      ref: main
  /models/protogen-infinity/: hf://huggingface.co/darkstorm2150/Protogen_Infinity_Official_Release
  /models/sd-v1-5/: hf://huggingface.co/VESSL/stable-diffusion-v1-5-checkpoint
  /models/sd-v2-1/: hf://huggingface.co/VESSL/stable-diffusion-v2-1-checkpoint
run:
  - command: |-
      pip install -r requirements.txt
      python -u launch.py --no-download-sd-model --ckpt-dir /models --no-half --no-gradio-queue --listen 
    workdir: /code/stable-diffusion-webui
interactive:
  max_runtime: 24h
  jupyter:
    idle_timeout: 120m
ports:
  - name: gradio
    type: http
    port: 7860
```