Spaces:
Sleeping
Sleeping
Commit
·
6aead1e
1
Parent(s):
499bb5d
Update app.py
Browse files
app.py
CHANGED
@@ -45,7 +45,7 @@ st.markdown(input_field_style, unsafe_allow_html=True)
|
|
45 |
|
46 |
|
47 |
# Creating Tabs
|
48 |
-
tab1, tab2 = st.tabs(["Image Generation", "
|
49 |
|
50 |
with tab1:
|
51 |
# Create two columns for layout
|
@@ -123,63 +123,9 @@ with tab1:
|
|
123 |
with tab2:
|
124 |
# ===========
|
125 |
# Define Streamlit UI elements
|
126 |
-
st.title('
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
prompt = st.text_area("Enter your prompt:",
|
131 |
-
"Raccoons astronaut in space, sci-fi, future, cold color palette, muted colors, detailed, 8k")
|
132 |
-
|
133 |
-
# Number of inference steps
|
134 |
-
num_inference_steps = st.slider("Number of Inference Steps",
|
135 |
-
min_value=1,
|
136 |
-
max_value=100,
|
137 |
-
value=40,
|
138 |
-
help="More steps might improve quality, with diminishing marginal returns. 30-50 seems best, but your mileage may vary.")
|
139 |
-
|
140 |
-
# Create an expandable section for optional parameters
|
141 |
-
with st.expander("Optional Parameters"):
|
142 |
-
# Random seed input
|
143 |
-
seed = st.number_input("Random seed",
|
144 |
-
value=42,
|
145 |
-
help="Set to the same value to generate the same image if other inputs are the same, change to generate a different image for same inputs.")
|
146 |
-
|
147 |
-
# Negative prompt input
|
148 |
-
negative_prompt = st.text_area("Enter your negative prompt:",
|
149 |
-
"anime, cartoon, graphic, text, painting, crayon, graphite, abstract glitch, blurry")
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
if st.button('Generate Image:'):
|
158 |
-
with st.spinner(f'Generating Image with {num_inference_steps} iterations'):
|
159 |
-
# ===============
|
160 |
-
# Example input data
|
161 |
-
prompt_input = {
|
162 |
-
"prompt": prompt,
|
163 |
-
"parameters": {
|
164 |
-
"num_inference_steps": num_inference_steps,
|
165 |
-
"seed": seed,
|
166 |
-
"negative_prompt": negative_prompt
|
167 |
-
}
|
168 |
-
}
|
169 |
-
|
170 |
-
# Make API request
|
171 |
-
response = requests.post(api_url, json=prompt_input)
|
172 |
-
|
173 |
-
# Process and display the response
|
174 |
-
if response.status_code == 200:
|
175 |
-
result = response.json()
|
176 |
-
# st.success(f"Prediction result: {result}")
|
177 |
-
image2 = display_image(decode_base64_image(result["generated_images"][0]))
|
178 |
-
st.header("SDXL Base")
|
179 |
-
st.image(image2,
|
180 |
-
caption=f"SDXL Base, {num_inference_steps} iterations")
|
181 |
-
else:
|
182 |
-
st.error(f"Error: {response.text}")
|
183 |
|
184 |
|
185 |
|
|
|
45 |
|
46 |
|
47 |
# Creating Tabs
|
48 |
+
tab1, tab2 = st.tabs(["Image Generation", "Architecture"])
|
49 |
|
50 |
with tab1:
|
51 |
# Create two columns for layout
|
|
|
123 |
with tab2:
|
124 |
# ===========
|
125 |
# Define Streamlit UI elements
|
126 |
+
st.title('Architecture')
|
127 |
+
st.image('./architecture.png', caption=f"Application Architecture")
|
128 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
|
130 |
|
131 |
|