From 3e6a8cc185e69c3fb3cfe0ab2f4484f907e64bc4 Mon Sep 17 00:00:00 2001 From: ZeroCool940711 Date: Wed, 14 Sep 2022 15:18:37 -0700 Subject: [PATCH] Small fix to the custom model list. --- scripts/txt2vid.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/scripts/txt2vid.py b/scripts/txt2vid.py index dc454f9..88f3201 100644 --- a/scripts/txt2vid.py +++ b/scripts/txt2vid.py @@ -599,14 +599,14 @@ def layout(): # If we have custom models available on the "models/custom" #folder then we show a menu to select which model we want to use, otherwise we use the main model for SD if st.session_state["CustomModel_available"]: - custom_model = st.selectbox("Custom Model:", st.session_state["custom_models"], - index=st.session_state["custom_models"].index(st.session_state["defaults"].general.default_model), - help="Select the model you want to use. This option is only available if you have custom models \ - on your 'models/custom' folder. The model name that will be shown here is the same as the name\ - the file for the model has on said folder, it is recommended to give the .ckpt file a name that \ - will make it easier for you to distinguish it from other models. Default: Stable Diffusion v1.4") + custom_model = st.selectbox("Custom Model:", st.session_state["defaults"].txt2vid.custom_models_list, + index=st.session_state["defaults"].txt2vid.custom_models_list.index(st.session_state["defaults"].txt2vid.default_model), + help="Select the model you want to use. This option is only available if you have custom models \ + on your 'models/custom' folder. The model name that will be shown here is the same as the name\ + the file for the model has on said folder, it is recommended to give the .ckpt file a name that \ + will make it easier for you to distinguish it from other models. Default: Stable Diffusion v1.4") else: - custom_model = "Stable Diffusion v1.4" + custom_model = "CompVis/stable-diffusion-v1-4" #st.session_state["weights_path"] = custom_model #else: @@ -676,17 +676,17 @@ def layout(): if generate_button: #print("Loading models") # load the models when we hit the generate button for the first time, it wont be loaded after that so dont worry. - load_models(False, False, False, RealESRGAN_model, CustomModel_available=CustomModel_available, custom_model=custom_model) + #load_models(False, False, False, st.session_state["RealESRGAN_model"], CustomModel_available=st.session_state["CustomModel_available"], custom_model=custom_model) # run video generation - image, seed, info, stats = txt2vid(prompts=prompt, gpu=st.session_state['defaults'].general.gpu, - num_steps=st.session_state.sampling_steps, max_frames=int(st.session_state.max_frames), - num_inference_steps=st.session_state.num_inference_steps, - cfg_scale=cfg_scale,do_loop=st.session_state["do_loop"], - seeds=seed, quality=100, eta=0.0, width=width, - height=height, weights_path=custom_model, scheduler=scheduler_name, - disable_tqdm=False, beta_start=st.session_state["beta_start"], beta_end=st.session_state["beta_end"], - beta_schedule=beta_scheduler_type) + image, seed, info, stats = txt2vid(prompts=prompt, gpu=st.session_state["defaults"].general.gpu, + num_steps=st.session_state.sampling_steps, max_frames=int(st.session_state.max_frames), + num_inference_steps=st.session_state.num_inference_steps, + cfg_scale=cfg_scale,do_loop=st.session_state["do_loop"], + seeds=seed, quality=100, eta=0.0, width=width, + height=height, weights_path=custom_model, scheduler=scheduler_name, + disable_tqdm=False, beta_start=st.session_state["beta_start"], beta_end=st.session_state["beta_end"], + beta_schedule=beta_scheduler_type) #message.success('Done!', icon="✅") message.success('Render Complete: ' + info + '; Stats: ' + stats, icon="✅")