Spaces:
Sleeping
Sleeping
Commit
·
ab22e14
1
Parent(s):
a896ada
Update app.py
Browse files
app.py
CHANGED
@@ -38,14 +38,14 @@ vae = vae.to(torch_device)
|
|
38 |
text_encoder = text_encoder.to(torch_device)
|
39 |
unet = unet.to(torch_device)
|
40 |
|
41 |
-
style_files = ['stable_diffusion/learned_embeddings/
|
42 |
-
'stable_diffusion/learned_embeddings/
|
43 |
-
'stable_diffusion/learned_embeddings/
|
44 |
|
45 |
images_without_loss = []
|
46 |
images_with_loss = []
|
47 |
|
48 |
-
seed_values = [
|
49 |
height = 512 # default height of Stable Diffusion
|
50 |
width = 512 # default width of Stable Diffusion
|
51 |
num_inference_steps = 5 # Number of denoising steps
|
@@ -277,10 +277,10 @@ def image_generator(prompt = "dog", loss_function=None):
|
|
277 |
|
278 |
return display_images_in_rows(generated_sd_images, titles)
|
279 |
|
280 |
-
description = "Generate an image with a prompt
|
281 |
|
282 |
demo = gr.Interface(image_generator,
|
283 |
-
inputs=[gr.Textbox(label="
|
284 |
-
gr.Radio(["Yes", "No"], value="No" , label="
|
285 |
-
outputs=gr.Plot(label="Generated Images"), title = "Stable Diffusion
|
286 |
-
demo.launch()
|
|
|
38 |
text_encoder = text_encoder.to(torch_device)
|
39 |
unet = unet.to(torch_device)
|
40 |
|
41 |
+
style_files = ['stable_diffusion/learned_embeddings/bird_style.bin', 'stable_diffusion/learned_embeddings/mid_journey_style.bin',
|
42 |
+
'stable_diffusion/learned_embeddings/hitokumoru.bin', 'stable_diffusion/learned_embeddings/depthmap.bin',
|
43 |
+
'stable_diffusion/learned_embeddings/arcane_style.bin']
|
44 |
|
45 |
images_without_loss = []
|
46 |
images_with_loss = []
|
47 |
|
48 |
+
seed_values = [10,20,30,40,50]
|
49 |
height = 512 # default height of Stable Diffusion
|
50 |
width = 512 # default width of Stable Diffusion
|
51 |
num_inference_steps = 5 # Number of denoising steps
|
|
|
277 |
|
278 |
return display_images_in_rows(generated_sd_images, titles)
|
279 |
|
280 |
+
description = "Generate an image with a prompt"
|
281 |
|
282 |
demo = gr.Interface(image_generator,
|
283 |
+
inputs=[gr.Textbox(label="prompt", type="text", value="cat fight"),
|
284 |
+
gr.Radio(["Yes", "No"], value="No" , label="loss checkbox")],
|
285 |
+
outputs=gr.Plot(label="Generated Images"), title = "Stable Diffusion", description=description)
|
286 |
+
demo.launch(debug=True)
|