Spaces:
Configuration error
Configuration error
Update index.html
Browse files- index.html +10 -1
index.html
CHANGED
@@ -14,4 +14,13 @@ prompt = st.text_input("Describe your image...")
|
|
14 |
if prompt:
|
15 |
with st.spinner("Generating..."):
|
16 |
image = pipe(prompt).images[0]
|
17 |
-
st.image(image, caption=prompt, use_column_width=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
if prompt:
|
15 |
with st.spinner("Generating..."):
|
16 |
image = pipe(prompt).images[0]
|
17 |
+
st.image(image, caption=prompt, use_column_width=True)
|
18 |
+
<button onclick="randomizePrompt()">Surprise Me</button>
|
19 |
+
|
20 |
+
<script>
|
21 |
+
function randomizePrompt() {
|
22 |
+
const adjectives = ["cartoon", "realistic", "cyberpunk", "watercolor"];
|
23 |
+
const randomAdjective = adjectives[Math.floor(Math.random() * adjectives.length)];
|
24 |
+
document.getElementById("prompt").value = `${randomAdjective} dog`;
|
25 |
+
}
|
26 |
+
</script>
|