Skip to content

Commit

Permalink
Added global negative prompt on config file. (#1670)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroCool940711 authored Nov 17, 2022
2 parents ef482ff + ef4cf8b commit 269107a
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[submodule "backend"]
path = backend
url = ../../Sygil-Dev/dalle-flow.git
[submodule "backend/clip-as-service"]
path = backend/clip-as-service
url = ../../jina-ai/clip-as-service.git
[submodule "backend/clipseg"]
path = backend/clipseg
url = ../../timojl/clipseg.git
[submodule "backend/dalle_flow"]
path = backend/dalle_flow
url = ../../Sygil-Dev/dalle-flow.git
[submodule "backend/glid-3-xl"]
path = backend/glid-3-xl
url = ../../jina-ai/glid-3-xl.git
[submodule "backend/latent-diffusion"]
path = backend/latent-diffusion
url = ../../CompVis/latent-diffusion.git
[submodule "backend/stable-diffusion"]
path = backend/stable-diffusion
url = ../../AmericanPresidentJimmyCarter/stable-diffusion.git
[submodule "backend/SwinIR"]
path = backend/SwinIR
url = ../../jina-ai/SwinIR.git
1 change: 1 addition & 0 deletions backend/SwinIR
Submodule SwinIR added at 41d8c9
1 change: 1 addition & 0 deletions backend/clip-as-service
Submodule clip-as-service added at 9bb7d1
1 change: 1 addition & 0 deletions backend/clipseg
Submodule clipseg added at 656e0c
1 change: 1 addition & 0 deletions backend/dalle_flow
Submodule dalle_flow added at 491c52
1 change: 1 addition & 0 deletions backend/glid-3-xl
Submodule glid-3-xl added at b21a3a
1 change: 1 addition & 0 deletions backend/latent-diffusion
Submodule latent-diffusion added at a506df
1 change: 1 addition & 0 deletions backend/stable-diffusion
Submodule stable-diffusion added at 2de63e
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 269107a

Please sign in to comment.