Skip to content

Commit 09104be

Browse files
committed
update app.py
1 parent 5fff05b commit 09104be

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

app.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,12 @@ def prepare_pipeline(model_version, enable_realism, enable_anti_blur):
7979
gc.collect()
8080
torch.cuda.empty_cache()
8181

82-
model_path = f'./models/InfiniteYou/infu_flux_v1.0/{model_version}'
82+
if model_version == 'aes_stage2':
83+
model_path = f'./models/InfiniteYou/infu_flux_v1.0/aes_stage2'
84+
elif model_version == 'sim_stage1':
85+
model_path = f'./models/InfiniteYou/infu_flux_v1.0/sim_stage1'
86+
else:
87+
raise ValueError(f'Model version {model_version} not supported.')
8388
print(f'Loading model from {model_path}')
8489

8590
pipeline = InfUFluxPipeline(
@@ -307,5 +312,6 @@ def generate_examples(id_image, control_image, prompt_text, seed, enable_realism
307312
prepare_pipeline(model_version=ModelVersion.DEFAULT_VERSION, enable_realism=ENABLE_REALISM_DEFAULT, enable_anti_blur=ENABLE_ANTI_BLUR_DEFAULT)
308313

309314
demo.queue()
310-
demo.launch(server_name='0.0.0.0') # IPv4
315+
demo.launch(server_name='localhost') # localhost
316+
# demo.launch(server_name='0.0.0.0') # IPv4
311317
# demo.launch(server_name='[::]') # IPv6

0 commit comments

Comments
 (0)