Spaces:
Running
Running
Komorebizyd
commited on
Commit
•
a5931f6
1
Parent(s):
f0be991
first commit
Browse files- README.md +2 -2
- requirements.txt +13 -0
- streamlit_app.py +63 -0
README.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
---
|
2 |
title: DrawApp
|
3 |
-
emoji:
|
4 |
colorFrom: green
|
5 |
colorTo: indigo
|
6 |
sdk: streamlit
|
7 |
sdk_version: 1.30.0
|
8 |
-
app_file:
|
9 |
pinned: false
|
10 |
license: apache-2.0
|
11 |
---
|
|
|
1 |
---
|
2 |
title: DrawApp
|
3 |
+
emoji: 🎨
|
4 |
colorFrom: green
|
5 |
colorTo: indigo
|
6 |
sdk: streamlit
|
7 |
sdk_version: 1.30.0
|
8 |
+
app_file: streamlit_app.py
|
9 |
pinned: false
|
10 |
license: apache-2.0
|
11 |
---
|
requirements.txt
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
PyPDF2
|
2 |
+
gtts
|
3 |
+
langid
|
4 |
+
python_docx
|
5 |
+
langchain
|
6 |
+
streamlit
|
7 |
+
streamlit-mic-recorder
|
8 |
+
openai
|
9 |
+
google-generativeai
|
10 |
+
pillow
|
11 |
+
PyDeepLX
|
12 |
+
huggingface
|
13 |
+
huggingface_hub
|
streamlit_app.py
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from huggingface_hub import InferenceClient
|
2 |
+
import streamlit as st
|
3 |
+
|
4 |
+
if "draw_model" not in st.session_state:
|
5 |
+
st.session_state.draw_model_list = {
|
6 |
+
"现实-AbsoluteReality_v1.8.1":"https://api-inference.huggingface.co/models/digiplay/AbsoluteReality_v1.8.1",
|
7 |
+
"现实-Absolute-Reality-1.81":"https://api-inference.huggingface.co/models/Lykon/absolute-reality-1.81",
|
8 |
+
"动漫-AingDiffusion9.2":"https://api-inference.huggingface.co/models/digiplay/AingDiffusion9.2",
|
9 |
+
"现实动漫-BluePencilRealistic_v01":"https://api-inference.huggingface.co/models/digiplay/bluePencilRealistic_v01",
|
10 |
+
"动漫写实-Counterfeit-v2.5":"https://api-inference.huggingface.co/models/gsdf/Counterfeit-V2.5",
|
11 |
+
"动漫写实-Counterfeit-v25-2.5d-tweak":"https://api-inference.huggingface.co/models/digiplay/counterfeitV2525d_tweak",
|
12 |
+
"动漫可爱-Cuteyukimix":"https://api-inference.huggingface.co/models/stablediffusionapi/cuteyukimix",
|
13 |
+
"动漫可爱-Cuteyukimixadorable":"https://api-inference.huggingface.co/models/stablediffusionapi/cuteyukimixadorable",
|
14 |
+
"现实动漫-Dreamshaper-7":"https://api-inference.huggingface.co/models/Lykon/dreamshaper-7",
|
15 |
+
"现实动漫-Dreamshaper_LCM_v7":"https://api-inference.huggingface.co/models/SimianLuo/LCM_Dreamshaper_v7",
|
16 |
+
"动漫3D-DucHaitenDreamWorld":"https://api-inference.huggingface.co/models/DucHaiten/DucHaitenDreamWorld",
|
17 |
+
"现实-EpiCRealism":"https://api-inference.huggingface.co/models/emilianJR/epiCRealism",
|
18 |
+
"现实照片-EpiCPhotoGasm":"https://api-inference.huggingface.co/models/Yntec/epiCPhotoGasm",
|
19 |
+
"动漫丰富-Ether-Blu-Mix-b5":"https://api-inference.huggingface.co/models/tensor-diffusion/Ether-Blu-Mix-V5",
|
20 |
+
"动漫-Flat-2d-Animerge":"https://api-inference.huggingface.co/models/jinaai/flat-2d-animerge",
|
21 |
+
"动漫风景-Genshin-Landscape-Diffusion":"https://api-inference.huggingface.co/models/Apocalypse-19/Genshin-Landscape-Diffusion",
|
22 |
+
"现实照片-Juggernaut-XL-v7":"https://api-inference.huggingface.co/models/stablediffusionapi/juggernaut-xl-v7",
|
23 |
+
"现实风景-Landscape_PhotoReal_v1":"https://api-inference.huggingface.co/models/digiplay/Landscape_PhotoReal_v1",
|
24 |
+
"艺术水墨-MoXin":"https://api-inference.huggingface.co/models/zhyemmmm/MoXin",
|
25 |
+
"现实写实-OnlyRealistic":"https://api-inference.huggingface.co/models/stablediffusionapi/onlyrealistic",
|
26 |
+
"现实-Realistic-Vision-v51":"https://api-inference.huggingface.co/models/stablediffusionapi/realistic-vision-v51",
|
27 |
+
"初始-StableDiffusion-2-1":"https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-2-1",
|
28 |
+
"初始-StableDiffusion-XL-0.9":"https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-0.9",
|
29 |
+
"动漫-TMND-Mix":"https://api-inference.huggingface.co/models/stablediffusionapi/tmnd-mix",
|
30 |
+
"animagine-XL-3.0":"https://api-inference.huggingface.co/models/cagliostrolab/animagine-xl-3.0",
|
31 |
+
"艺术-Zavychromaxl-v3":"https://api-inference.huggingface.co/models/stablediffusionapi/zavychromaxlv3",
|
32 |
+
"Dalle-v1.1":"https://api-inference.huggingface.co/models/dataautogpt3/OpenDalleV1.1",
|
33 |
+
"Dalle-3-xl":"https://api-inference.huggingface.co/models/openskyml/dalle-3-xl",
|
34 |
+
"playground-v2-美化":"https://api-inference.huggingface.co/models/playgroundai/playground-v2-1024px-aesthetic",
|
35 |
+
"Dalle-proteus-v0.2":"https://api-inference.huggingface.co/models/dataautogpt3/ProteusV0.2",
|
36 |
+
}
|
37 |
+
st.session_state.draw_model = st.session_state.draw_model_list["Dalle-v1.1"]
|
38 |
+
|
39 |
+
|
40 |
+
show_app = st.container()
|
41 |
+
|
42 |
+
def change_paramater():
|
43 |
+
st.session_state.draw_model = st.session_state.draw_model
|
44 |
+
|
45 |
+
|
46 |
+
def free_text_to_image(text):
|
47 |
+
client = InferenceClient(model=st.session_state.draw_model_list[st.session_state.draw_model])
|
48 |
+
image = client.text_to_image(text)
|
49 |
+
return image
|
50 |
+
|
51 |
+
|
52 |
+
def main(prompt):
|
53 |
+
show_app.write("**You:** " + prompt)
|
54 |
+
image = free_text_to_image(prompt)
|
55 |
+
show_app.image(image,use_column_width=True)
|
56 |
+
|
57 |
+
|
58 |
+
with st.sidebar:
|
59 |
+
st.session_state.draw_model = st.selectbox('Draw Models', sorted(st.session_state.draw_model_list.keys(),key=lambda x:x.split("-")[0]),on_change=change_paramater)
|
60 |
+
|
61 |
+
prompt = st.chat_input("Send your prompt")
|
62 |
+
if prompt:
|
63 |
+
main(prompt)
|