- Increased the max value for the width and height sliders on the txt2img tab.

- Fixed a leftover line from removing the home tab.
This commit is contained in:
ZeroCool940711 2022-09-15 17:18:36 -07:00
parent a92a59238f
commit 0645c7cf64
2 changed files with 9 additions and 5 deletions

View File

@ -157,8 +157,8 @@ def layout():
col1, col2, col3 = st.columns([1,2,1], gap="large")
with col1:
width = st.slider("Width:", min_value=64, max_value=1024, value=st.session_state['defaults'].txt2img.width, step=64)
height = st.slider("Height:", min_value=64, max_value=1024, value=st.session_state['defaults'].txt2img.height, step=64)
width = st.slider("Width:", min_value=64, max_value=4096, value=st.session_state['defaults'].txt2img.width, step=64)
height = st.slider("Height:", min_value=64, max_value=4096, value=st.session_state['defaults'].txt2img.height, step=64)
cfg_scale = st.slider("CFG (Classifier Free Guidance Scale):", min_value=1.0, max_value=30.0, value=st.session_state['defaults'].txt2img.cfg_scale, step=0.5, help="How strongly the image should follow the prompt.")
seed = st.text_input("Seed:", value=st.session_state['defaults'].txt2img.seed, help=" The seed to use, if left blank a random seed will be generated.")
batch_count = st.slider("Batch count.", min_value=1, max_value=100, value=st.session_state['defaults'].txt2img.batch_count, step=1, help="How many iterations or batches of images to generate in total.")
@ -218,7 +218,7 @@ def layout():
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")
st.session_state.sampling_steps = st.slider("Sampling Steps", value=st.session_state['defaults'].txt2img.sampling_steps, min_value=1, max_value=250)
st.session_state.sampling_steps = st.slider("Sampling Steps", value=st.session_state['defaults'].txt2img.sampling_steps, min_value=10, max_value=500, step=10)
sampler_name_list = ["k_lms", "k_euler", "k_euler_a", "k_dpm_2", "k_dpm_2_a", "k_heun", "PLMS", "DDIM"]
sampler_name = st.selectbox("Sampling method", sampler_name_list,
@ -312,7 +312,7 @@ def layout():
st.markdown(createHTMLGallery(output_images,seeds), unsafe_allow_html=True)
st.session_state['historyTab'] = [history_tab,col1,col2,col3,PlaceHolder,col1_cont,col2_cont,col3_cont]
#st.session_state['historyTab'] = [history_tab,col1,col2,col3,PlaceHolder,col1_cont,col2_cont,col3_cont]
except (StopException, KeyError):
print(f"Received Streamlit StopException")

View File

@ -219,6 +219,7 @@ def txt2vid(
weights_path = "CompVis/stable-diffusion-v1-4",
scheduler="klms", # choices: default, ddim, klms
disable_tqdm = False,
fp = None,
#-----------------------------------------------
beta_start = 0.0001,
beta_end = 0.00012,
@ -378,6 +379,9 @@ def txt2vid(
st.session_state["pipe"].scheduler = SCHEDULERS[scheduler]
if fp is not None and hasattr(st.session_state["pipe"], "embedding_manager"):
st.session_state["pipe"].embedding_manager.load(fp['name'])
# get the conditional text embeddings based on the prompt
text_input = st.session_state["pipe"].tokenizer(prompts, padding="max_length", max_length=st.session_state["pipe"].tokenizer.model_max_length, truncation=True, return_tensors="pt")
cond_embeddings = st.session_state["pipe"].text_encoder(text_input.input_ids.to(torch_device))[0] # shape [1, 77, 768]
@ -685,7 +689,7 @@ def layout():
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"],
disable_tqdm=False, fp=st.session_state.defaults.general.fp, beta_start=st.session_state["beta_start"], beta_end=st.session_state["beta_end"],
beta_schedule=beta_scheduler_type)
#message.success('Done!', icon="✅")