Spaces:
Running
on
Zero
Running
on
Zero
Move to ZeroGPU
Browse filesWorking example : https://huggingface.co/spaces/cbensimon/playground-v2
Should drop queue size quite drastically (especially if setting replicas = 2)
app.py
CHANGED
@@ -7,6 +7,7 @@ import uuid
|
|
7 |
import gradio as gr
|
8 |
import numpy as np
|
9 |
from PIL import Image
|
|
|
10 |
import torch
|
11 |
from diffusers import DiffusionPipeline
|
12 |
|
@@ -55,6 +56,7 @@ def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
|
|
55 |
return seed
|
56 |
|
57 |
|
|
|
58 |
def generate(
|
59 |
prompt: str,
|
60 |
negative_prompt: str = "",
|
|
|
7 |
import gradio as gr
|
8 |
import numpy as np
|
9 |
from PIL import Image
|
10 |
+
import spaces
|
11 |
import torch
|
12 |
from diffusers import DiffusionPipeline
|
13 |
|
|
|
56 |
return seed
|
57 |
|
58 |
|
59 |
+
@spaces.GPU
|
60 |
def generate(
|
61 |
prompt: str,
|
62 |
negative_prompt: str = "",
|