Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -73,15 +73,24 @@ def is_empty_image(im: Image.Image) -> bool:
|
|
73 |
|
74 |
### Argument passing
|
75 |
|
76 |
-
parser = argparse.ArgumentParser(description='Semantic Palette demo powered by StreamMultiDiffusion with SDXL support.')
|
77 |
-
parser.add_argument('-H', '--height', type=int, default=1024)
|
78 |
-
parser.add_argument('-W', '--width', type=int, default=2560)
|
79 |
-
parser.add_argument('--model', type=str, default=None
|
80 |
-
parser.add_argument('--bootstrap_steps', type=int, default=1)
|
81 |
-
parser.add_argument('--seed', type=int, default=-1)
|
82 |
-
parser.add_argument('--device', type=int, default=0)
|
83 |
-
parser.add_argument('--port', type=int, default=8000)
|
84 |
-
opt = parser.parse_args()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
|
86 |
|
87 |
### Global variables and data structures
|
@@ -99,7 +108,7 @@ else:
|
|
99 |
model_dict = {os.path.splitext(os.path.basename(opt.model))[0]: opt.model}
|
100 |
|
101 |
models = {
|
102 |
-
k: StableMultiDiffusionSDXLPipeline(device, hf_key=v, has_i2t=False)
|
103 |
for k, v in model_dict.items()
|
104 |
}
|
105 |
|
@@ -872,4 +881,4 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
|
|
872 |
)
|
873 |
|
874 |
if __name__ == '__main__':
|
875 |
-
demo.
|
|
|
73 |
|
74 |
### Argument passing
|
75 |
|
76 |
+
# parser = argparse.ArgumentParser(description='Semantic Palette demo powered by StreamMultiDiffusion with SDXL support.')
|
77 |
+
# parser.add_argument('-H', '--height', type=int, default=1024)
|
78 |
+
# parser.add_argument('-W', '--width', type=int, default=2560)
|
79 |
+
# parser.add_argument('--model', type=str, default=None)
|
80 |
+
# parser.add_argument('--bootstrap_steps', type=int, default=1)
|
81 |
+
# parser.add_argument('--seed', type=int, default=-1)
|
82 |
+
# parser.add_argument('--device', type=int, default=0)
|
83 |
+
# parser.add_argument('--port', type=int, default=8000)
|
84 |
+
# opt = parser.parse_args()
|
85 |
+
opt = argparse.Namespace()
|
86 |
+
opt.height = 1024
|
87 |
+
opt.width = 2560
|
88 |
+
opt.model = None
|
89 |
+
opt.bootstrap_steps = 2
|
90 |
+
opt.seed = -1
|
91 |
+
# opt.device = 0
|
92 |
+
# opt.port = 8000
|
93 |
+
|
94 |
|
95 |
|
96 |
### Global variables and data structures
|
|
|
108 |
model_dict = {os.path.splitext(os.path.basename(opt.model))[0]: opt.model}
|
109 |
|
110 |
models = {
|
111 |
+
k: StableMultiDiffusionSDXLPipeline(device, hf_key=v, has_i2t=False).cuda()
|
112 |
for k, v in model_dict.items()
|
113 |
}
|
114 |
|
|
|
881 |
)
|
882 |
|
883 |
if __name__ == '__main__':
|
884 |
+
demo.queue(max_size=20).launch()
|