Skip to content

Commit

Permalink
Added global negative prompt on config file.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroCool940711 committed Nov 17, 2022
1 parent ae47c55 commit ef4cf8b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions configs/webui/webui_streamlit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ general:
admin:
hide_server_setting: False
hide_browser_setting: False
global_negative_prompt: ""

debug:
enable_hydralit: False
Expand Down
4 changes: 4 additions & 0 deletions scripts/img2img.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,10 @@ def layout():
placeholder = "A corgi wearing a top hat as an oil painting."
prompt = st.text_area("Input Text","", placeholder=placeholder, height=54)
sygil_suggestions.suggestion_area(placeholder)

if "defaults" in st.session_state:
if st.session_state['defaults'].admin.global_negative_prompt:
prompt += f"### {st.session_state['defaults'].admin.global_negative_prompt}"

# Every form must have a submit button, the extra blank spaces is a temp way to align it with the input field. Needs to be done in CSS or some other way.
img2img_generate_col.write("")
Expand Down
6 changes: 6 additions & 0 deletions scripts/txt2img.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,12 @@ def layout():
placeholder = "A corgi wearing a top hat as an oil painting."
prompt = st.text_area("Input Text","", placeholder=placeholder, height=54)
sygil_suggestions.suggestion_area(placeholder)

if "defaults" in st.session_state:
if st.session_state['defaults'].admin.global_negative_prompt:
prompt += f"### {st.session_state['defaults'].admin.global_negative_prompt}"

print(prompt)

# creating the page layout using columns
col1, col2, col3 = st.columns([2,5,2], gap="large")
Expand Down
4 changes: 4 additions & 0 deletions scripts/txt2vid.py
Original file line number Diff line number Diff line change
Expand Up @@ -1601,6 +1601,10 @@ def layout():
placeholder = "A corgi wearing a top hat as an oil painting."
prompt = st.text_area("Input Text","", placeholder=placeholder, height=54)
sygil_suggestions.suggestion_area(placeholder)

if "defaults" in st.session_state:
if st.session_state['defaults'].admin.global_negative_prompt:
prompt += f"### {st.session_state['defaults'].admin.global_negative_prompt}"

# Every form must have a submit button, the extra blank spaces is a temp way to align it with the input field. Needs to be done in CSS or some other way.
generate_col1.write("")
Expand Down

0 comments on commit ef4cf8b

Please sign in to comment.