Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -132,13 +132,6 @@ pipe.enable_free_init(method="butterworth", use_fast_sampling=fast)
|
|
| 132 |
|
| 133 |
pipe_flux = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16, token=os.getenv("hf_token")).to(device,dtype=dtype)
|
| 134 |
|
| 135 |
-
# Parallelism
|
| 136 |
-
|
| 137 |
-
def parallel(func,*args):
|
| 138 |
-
with Pool(len(args)) as pool:
|
| 139 |
-
res = pool.map(func, args)
|
| 140 |
-
return list(res)
|
| 141 |
-
|
| 142 |
# functionality
|
| 143 |
|
| 144 |
def run(cmd):
|
|
@@ -246,9 +239,8 @@ def handle_generate(*inp):
|
|
| 246 |
inp[1] = ", ".join(_do)
|
| 247 |
|
| 248 |
ln = len(result)
|
| 249 |
-
|
| 250 |
|
| 251 |
-
pipe_out = parallel( pipe_generate, *parallel_args )
|
| 252 |
names = []
|
| 253 |
for i in pipe_out:
|
| 254 |
name = generate_random_string(12)+".png"
|
|
|
|
| 132 |
|
| 133 |
pipe_flux = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16, token=os.getenv("hf_token")).to(device,dtype=dtype)
|
| 134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
# functionality
|
| 136 |
|
| 137 |
def run(cmd):
|
|
|
|
| 239 |
inp[1] = ", ".join(_do)
|
| 240 |
|
| 241 |
ln = len(result)
|
| 242 |
+
pipe_out = [pipe_generate(*inp) for i in range(ln)]
|
| 243 |
|
|
|
|
| 244 |
names = []
|
| 245 |
for i in pipe_out:
|
| 246 |
name = generate_random_string(12)+".png"
|