From ae47c552224695545132b0a698c395d1b567159e Mon Sep 17 00:00:00 2001 From: ZeroCool940711 Date: Thu, 17 Nov 2022 03:00:57 -0700 Subject: [PATCH 1/2] Added dalle-flow submodule as starting point for the new backend using jina. --- .gitmodules | 24 ++++++++++++++++++++++++ backend/SwinIR | 1 + backend/clip-as-service | 1 + backend/clipseg | 1 + backend/dalle_flow | 1 + backend/glid-3-xl | 1 + backend/latent-diffusion | 1 + backend/stable-diffusion | 1 + 8 files changed, 31 insertions(+) create mode 100644 .gitmodules create mode 160000 backend/SwinIR create mode 160000 backend/clip-as-service create mode 160000 backend/clipseg create mode 160000 backend/dalle_flow create mode 160000 backend/glid-3-xl create mode 160000 backend/latent-diffusion create mode 160000 backend/stable-diffusion diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..de7610af8 --- /dev/null +++ b/.gitmodules @@ -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 diff --git a/backend/SwinIR b/backend/SwinIR new file mode 160000 index 000000000..41d8c990a --- /dev/null +++ b/backend/SwinIR @@ -0,0 +1 @@ +Subproject commit 41d8c990adfbeeba929f20ae11d3a8494a83d12d diff --git a/backend/clip-as-service b/backend/clip-as-service new file mode 160000 index 000000000..9bb7d1f47 --- /dev/null +++ b/backend/clip-as-service @@ -0,0 +1 @@ +Subproject commit 9bb7d1f47d19e15e844108dec5f84cabcce7975d diff --git a/backend/clipseg b/backend/clipseg new file mode 160000 index 000000000..656e0c662 --- /dev/null +++ b/backend/clipseg @@ -0,0 +1 @@ +Subproject commit 656e0c662bd1c9a5ae511011642da5b7d8503312 diff --git a/backend/dalle_flow b/backend/dalle_flow new file mode 160000 index 000000000..491c52af8 --- /dev/null +++ b/backend/dalle_flow @@ -0,0 +1 @@ +Subproject commit 491c52af85f6d75d30094974c97a5a0ed53ba6db diff --git a/backend/glid-3-xl b/backend/glid-3-xl new file mode 160000 index 000000000..b21a3acdd --- /dev/null +++ b/backend/glid-3-xl @@ -0,0 +1 @@ +Subproject commit b21a3acdd478a4fa41c529b55199c8ac3b1b807a diff --git a/backend/latent-diffusion b/backend/latent-diffusion new file mode 160000 index 000000000..a506df575 --- /dev/null +++ b/backend/latent-diffusion @@ -0,0 +1 @@ +Subproject commit a506df5756472e2ebaf9078affdde2c4f1502cd4 diff --git a/backend/stable-diffusion b/backend/stable-diffusion new file mode 160000 index 000000000..2de63ea62 --- /dev/null +++ b/backend/stable-diffusion @@ -0,0 +1 @@ +Subproject commit 2de63ea62862106de27706cd280e692f34c12d9f From ef4cf8bc9869b74ecb4e56be3a96b2b4e371dbd6 Mon Sep 17 00:00:00 2001 From: ZeroCool940711 Date: Thu, 17 Nov 2022 10:11:42 -0700 Subject: [PATCH 2/2] Added global negative prompt on config file. --- configs/webui/webui_streamlit.yaml | 1 + scripts/img2img.py | 4 ++++ scripts/txt2img.py | 6 ++++++ scripts/txt2vid.py | 4 ++++ 4 files changed, 15 insertions(+) diff --git a/configs/webui/webui_streamlit.yaml b/configs/webui/webui_streamlit.yaml index c3859cc21..ec9376554 100644 --- a/configs/webui/webui_streamlit.yaml +++ b/configs/webui/webui_streamlit.yaml @@ -70,6 +70,7 @@ general: admin: hide_server_setting: False hide_browser_setting: False + global_negative_prompt: "" debug: enable_hydralit: False diff --git a/scripts/img2img.py b/scripts/img2img.py index e7a1bf84c..bf54cc7fc 100644 --- a/scripts/img2img.py +++ b/scripts/img2img.py @@ -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("") diff --git a/scripts/txt2img.py b/scripts/txt2img.py index b18019e10..4fa9870cb 100644 --- a/scripts/txt2img.py +++ b/scripts/txt2img.py @@ -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") diff --git a/scripts/txt2vid.py b/scripts/txt2vid.py index 504a507bd..1edcfe4d5 100644 --- a/scripts/txt2vid.py +++ b/scripts/txt2vid.py @@ -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("")