Spaces:
Sleeping
Sleeping
Update to use ZeroGPU spaces feature
Browse files
app.py
CHANGED
|
@@ -11,6 +11,8 @@ from diffusers import StableDiffusion3Pipeline
|
|
| 11 |
from diffusers import StableDiffusionPipeline
|
| 12 |
from diffusers import DiffusionPipeline
|
| 13 |
|
|
|
|
|
|
|
| 14 |
#from transformers import pipeline
|
| 15 |
import gradio as gr
|
| 16 |
|
|
@@ -79,6 +81,7 @@ def base64_to_pil(img_base64):
|
|
| 79 |
# return result_image
|
| 80 |
|
| 81 |
# Generate function
|
|
|
|
| 82 |
def generate(prompt, negative_prompt, steps, guidance, width, height):
|
| 83 |
# Ensure width and height are multiples of 8 (required by Stable Diffusion)
|
| 84 |
width = int(width) - (int(width) % 8)
|
|
|
|
| 11 |
from diffusers import StableDiffusionPipeline
|
| 12 |
from diffusers import DiffusionPipeline
|
| 13 |
|
| 14 |
+
import spaces
|
| 15 |
+
|
| 16 |
#from transformers import pipeline
|
| 17 |
import gradio as gr
|
| 18 |
|
|
|
|
| 81 |
# return result_image
|
| 82 |
|
| 83 |
# Generate function
|
| 84 |
+
@spaces.GPU(duration=120) # Designed to be effect-free in non-ZeroGPU environments, ensuring compatibility across different setups.
|
| 85 |
def generate(prompt, negative_prompt, steps, guidance, width, height):
|
| 86 |
# Ensure width and height are multiples of 8 (required by Stable Diffusion)
|
| 87 |
width = int(width) - (int(width) % 8)
|