Merge remote-tracking branch 'upstream/main' into queues

This commit is contained in:
Chris Malone 2025-03-24 18:06:34 +11:00
commit bb3f99012f
2 changed files with 13 additions and 3 deletions

View File

@ -256,6 +256,7 @@ You can define multiple lines of macros. If there is only one macro line, the ap
--advanced : turn on the advanced mode while launching the app\ --advanced : turn on the advanced mode while launching the app\
--i2v-settings : path to launch settings for i2v\ --i2v-settings : path to launch settings for i2v\
--t2v-settings : path to launch settings for t2v --t2v-settings : path to launch settings for t2v
--listen : make server accessible on network
### Profiles (for power users only) ### Profiles (for power users only)
You can choose between 5 profiles, but two are really relevant here : You can choose between 5 profiles, but two are really relevant here :

View File

@ -397,6 +397,12 @@ def _parse_args():
help="Enable pytorch compilation" help="Enable pytorch compilation"
) )
parser.add_argument(
"--listen",
action="store_true",
help="Server accessible on local network"
)
# parser.add_argument( # parser.add_argument(
# "--fast", # "--fast",
# action="store_true", # action="store_true",
@ -1361,7 +1367,7 @@ def generate_video(
'num_inference_steps': num_inference_steps, 'num_inference_steps': num_inference_steps,
} }
metadata_choice = server_config["metadata_choice"] metadata_choice = server_config.get("metadata_choice","metadata")
if metadata_choice == "json": if metadata_choice == "json":
with open(video_path.replace('.mp4', '.json'), 'w') as f: with open(video_path.replace('.mp4', '.json'), 'w') as f:
json.dump(configs, f, indent=4) json.dump(configs, f, indent=4)
@ -2360,6 +2366,7 @@ def create_demo():
t2v_loras_choices, t2v_lset_name, t2v_header, t2v_state = generate_video_tab() t2v_loras_choices, t2v_lset_name, t2v_header, t2v_state = generate_video_tab()
with gr.Tab("Image To Video", id="i2v") as i2v_tab: with gr.Tab("Image To Video", id="i2v") as i2v_tab:
i2v_loras_choices, i2v_lset_name, i2v_header, i2v_state = generate_video_tab(True) i2v_loras_choices, i2v_lset_name, i2v_header, i2v_state = generate_video_tab(True)
if not args.lock_config:
with gr.Tab("Configuration"): with gr.Tab("Configuration"):
generate_configuration_tab() generate_configuration_tab()
with gr.Tab("About"): with gr.Tab("About"):
@ -2383,6 +2390,8 @@ if __name__ == "__main__":
if server_port == 0: if server_port == 0:
server_port = int(os.getenv("SERVER_PORT", "7860")) server_port = int(os.getenv("SERVER_PORT", "7860"))
server_name = args.server_name server_name = args.server_name
if args.listen:
server_name = "0.0.0.0"
if len(server_name) == 0: if len(server_name) == 0:
server_name = os.getenv("SERVER_NAME", "localhost") server_name = os.getenv("SERVER_NAME", "localhost")
demo = create_demo() demo = create_demo()