Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ import torch
|
|
| 3 |
from PIL import Image
|
| 4 |
from diffusers import DiffusionPipeline
|
| 5 |
import os
|
|
|
|
| 6 |
|
| 7 |
# Constants
|
| 8 |
#SAFETY_CHECKER = os.environ.get("SAFETY_CHECKER", "0") == "1"
|
|
@@ -18,6 +19,7 @@ pipe = DiffusionPipeline.from_pretrained(
|
|
| 18 |
#if SAFETY_CHECKER:
|
| 19 |
# Implement or import the safety checker code here
|
| 20 |
|
|
|
|
| 21 |
def generate_image(prompt, num_inference_steps=50, guidance_scale=7):
|
| 22 |
# Generate image
|
| 23 |
results = pipe(prompt=prompt, num_inference_steps=num_inference_steps, guidance_scale=guidance_scale)
|
|
|
|
| 3 |
from PIL import Image
|
| 4 |
from diffusers import DiffusionPipeline
|
| 5 |
import os
|
| 6 |
+
import spaces
|
| 7 |
|
| 8 |
# Constants
|
| 9 |
#SAFETY_CHECKER = os.environ.get("SAFETY_CHECKER", "0") == "1"
|
|
|
|
| 19 |
#if SAFETY_CHECKER:
|
| 20 |
# Implement or import the safety checker code here
|
| 21 |
|
| 22 |
+
@spaces.GPU(enable_queue=True)
|
| 23 |
def generate_image(prompt, num_inference_steps=50, guidance_scale=7):
|
| 24 |
# Generate image
|
| 25 |
results = pipe(prompt=prompt, num_inference_steps=num_inference_steps, guidance_scale=guidance_scale)
|