Spaces:
Paused
Paused
removing @spaces to use with standard GPUs
Browse files
app.py
CHANGED
|
@@ -5,11 +5,13 @@ import uuid
|
|
| 5 |
import gradio as gr
|
| 6 |
import numpy as np
|
| 7 |
from PIL import Image
|
| 8 |
-
import spaces
|
| 9 |
import torch
|
| 10 |
from diffusers import StableDiffusion3Pipeline, DPMSolverMultistepScheduler, AutoencoderKL, StableDiffusion3Img2ImgPipeline
|
| 11 |
from huggingface_hub import snapshot_download
|
| 12 |
|
|
|
|
|
|
|
| 13 |
huggingface_token = os.getenv("HUGGINGFACE_TOKEN")
|
| 14 |
|
| 15 |
model_path = snapshot_download(
|
|
@@ -51,7 +53,7 @@ def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
|
|
| 51 |
return seed
|
| 52 |
|
| 53 |
|
| 54 |
-
@spaces.GPU
|
| 55 |
def generate(
|
| 56 |
prompt:str,
|
| 57 |
negative_prompt: str = "",
|
|
@@ -89,7 +91,7 @@ def generate(
|
|
| 89 |
return output
|
| 90 |
|
| 91 |
|
| 92 |
-
@spaces.GPU
|
| 93 |
def img2img_generate(
|
| 94 |
prompt:str,
|
| 95 |
init_image: gr.Image,
|
|
|
|
| 5 |
import gradio as gr
|
| 6 |
import numpy as np
|
| 7 |
from PIL import Image
|
| 8 |
+
# import spaces
|
| 9 |
import torch
|
| 10 |
from diffusers import StableDiffusion3Pipeline, DPMSolverMultistepScheduler, AutoencoderKL, StableDiffusion3Img2ImgPipeline
|
| 11 |
from huggingface_hub import snapshot_download
|
| 12 |
|
| 13 |
+
# Ctrl+F for "spaces" to use with ZeroGPU
|
| 14 |
+
|
| 15 |
huggingface_token = os.getenv("HUGGINGFACE_TOKEN")
|
| 16 |
|
| 17 |
model_path = snapshot_download(
|
|
|
|
| 53 |
return seed
|
| 54 |
|
| 55 |
|
| 56 |
+
# @spaces.GPU
|
| 57 |
def generate(
|
| 58 |
prompt:str,
|
| 59 |
negative_prompt: str = "",
|
|
|
|
| 91 |
return output
|
| 92 |
|
| 93 |
|
| 94 |
+
# @spaces.GPU
|
| 95 |
def img2img_generate(
|
| 96 |
prompt:str,
|
| 97 |
init_image: gr.Image,
|