Spaces:
Sleeping
Sleeping
add NSFW checker and GPU mode
Browse files
app.py
CHANGED
@@ -17,6 +17,7 @@ from torchvision.utils import save_image
|
|
17 |
import utils.ptp_utils as ptp_utils
|
18 |
|
19 |
import torchvision.transforms as transforms
|
|
|
20 |
|
21 |
try:
|
22 |
import xformers
|
@@ -37,6 +38,7 @@ css = """
|
|
37 |
|
38 |
|
39 |
class GlobalText:
|
|
|
40 |
def __init__(self):
|
41 |
|
42 |
# config dirs
|
@@ -117,7 +119,7 @@ class GlobalText:
|
|
117 |
print(f'load {base_model_dropdown} model success!')
|
118 |
return gr.Dropdown()
|
119 |
|
120 |
-
|
121 |
def generate(self, source, style,
|
122 |
num_steps, co_feat_step,strength,
|
123 |
start_ac_layer, end_ac_layer,
|
|
|
17 |
import utils.ptp_utils as ptp_utils
|
18 |
|
19 |
import torchvision.transforms as transforms
|
20 |
+
import spaces
|
21 |
|
22 |
try:
|
23 |
import xformers
|
|
|
38 |
|
39 |
|
40 |
class GlobalText:
|
41 |
+
@spaces.GPU
|
42 |
def __init__(self):
|
43 |
|
44 |
# config dirs
|
|
|
119 |
print(f'load {base_model_dropdown} model success!')
|
120 |
return gr.Dropdown()
|
121 |
|
122 |
+
@spaces.GPU
|
123 |
def generate(self, source, style,
|
124 |
num_steps, co_feat_step,strength,
|
125 |
start_ac_layer, end_ac_layer,
|