Spaces:
Configuration error
Configuration error
Update index.html
Browse files- index.html +2 -11
index.html
CHANGED
@@ -3,7 +3,7 @@ from diffusers import StableDiffusionPipeline
|
|
3 |
import torch
|
4 |
|
5 |
# Load the model
|
6 |
-
model_id = "runwayml/stable-diffusion-
|
7 |
pipe = StableDiffusionPipeline.from_pretrained(model_id)
|
8 |
pipe = pipe.to("cuda") # Runs on Hugging Face's GPU servers
|
9 |
|
@@ -14,13 +14,4 @@ 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)
|
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>
|
|
|
3 |
import torch
|
4 |
|
5 |
# Load the model
|
6 |
+
model_id = "runwayml/stable-diffusion-v1-5"
|
7 |
pipe = StableDiffusionPipeline.from_pretrained(model_id)
|
8 |
pipe = pipe.to("cuda") # Runs on Hugging Face's GPU servers
|
9 |
|
|
|
14 |
if prompt:
|
15 |
with st.spinner("Generating..."):
|
16 |
image = pipe(prompt).images[0]
|
17 |
+
st.image(image, caption=prompt, use_column_width=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|