Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from os import path
|
|
5 |
from safetensors.torch import load_file
|
6 |
import huggingface_hub
|
7 |
from huggingface_hub import hf_hub_download
|
8 |
-
|
9 |
|
10 |
cache_path = path.join(path.dirname(path.abspath(__file__)), "models")
|
11 |
os.environ["TRANSFORMERS_CACHE"] = cache_path
|
@@ -93,7 +93,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
93 |
with gr.Column(scale=4):
|
94 |
output = gr.Image(label="Your Generated Image")
|
95 |
|
96 |
-
|
97 |
def process_image(height, width, steps, scales, prompt, seed, preset_prompt):
|
98 |
global pipe
|
99 |
with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16), timer("inference"):
|
|
|
5 |
from safetensors.torch import load_file
|
6 |
import huggingface_hub
|
7 |
from huggingface_hub import hf_hub_download
|
8 |
+
import spaces
|
9 |
|
10 |
cache_path = path.join(path.dirname(path.abspath(__file__)), "models")
|
11 |
os.environ["TRANSFORMERS_CACHE"] = cache_path
|
|
|
93 |
with gr.Column(scale=4):
|
94 |
output = gr.Image(label="Your Generated Image")
|
95 |
|
96 |
+
@spaces.GPU
|
97 |
def process_image(height, width, steps, scales, prompt, seed, preset_prompt):
|
98 |
global pipe
|
99 |
with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16), timer("inference"):
|