Spaces:
Configuration error
Configuration error
load_model
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ import torch
|
|
| 9 |
from collections import Counter
|
| 10 |
import random
|
| 11 |
|
| 12 |
-
|
| 13 |
|
| 14 |
pipe = None
|
| 15 |
|
|
@@ -136,7 +136,7 @@ def outpaint_image(image):
|
|
| 136 |
|
| 137 |
return image
|
| 138 |
|
| 139 |
-
|
| 140 |
def predict_image(cond_image, prompt, negative_prompt):
|
| 141 |
generator = torch.Generator()
|
| 142 |
generator.manual_seed(random.randint(0, 2147483647))
|
|
@@ -160,7 +160,7 @@ def predict_image(cond_image, prompt, negative_prompt):
|
|
| 160 |
|
| 161 |
return image
|
| 162 |
|
| 163 |
-
|
| 164 |
|
| 165 |
# Gradioアプリケーション
|
| 166 |
with gr.Blocks() as demo:
|
|
|
|
| 9 |
from collections import Counter
|
| 10 |
import random
|
| 11 |
|
| 12 |
+
import spaces
|
| 13 |
|
| 14 |
pipe = None
|
| 15 |
|
|
|
|
| 136 |
|
| 137 |
return image
|
| 138 |
|
| 139 |
+
@spaces.GPU
|
| 140 |
def predict_image(cond_image, prompt, negative_prompt):
|
| 141 |
generator = torch.Generator()
|
| 142 |
generator.manual_seed(random.randint(0, 2147483647))
|
|
|
|
| 160 |
|
| 161 |
return image
|
| 162 |
|
| 163 |
+
load_model()
|
| 164 |
|
| 165 |
# Gradioアプリケーション
|
| 166 |
with gr.Blocks() as demo:
|