srikanthp07 commited on
Commit
ab22e14
·
1 Parent(s): a896ada

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
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/arcane-style-jv.bin', 'stable_diffusion/learned_embeddings/birb-style.bin',
42
- 'stable_diffusion/learned_embeddings/dr-strange.bin', 'stable_diffusion/learned_embeddings/midjourney-style.bin',
43
- 'stable_diffusion/learned_embeddings/oil_style.bin']
44
 
45
  images_without_loss = []
46
  images_with_loss = []
47
 
48
- seed_values = [8,16,50,80,128]
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 and apply vibrance loss if you wish to. Note that the app is hosted on a cpu and it takes atleast 15 minutes for generating images without loss. Please feel free to clone the space and use it with a GPU after increase the inference steps to more than 10 for better results"
281
 
282
  demo = gr.Interface(image_generator,
283
- inputs=[gr.Textbox(label="Enter prompt for generation", type="text", value="dog sitting on a bench"),
284
- gr.Radio(["Yes", "No"], value="No" , label="Apply vibrance loss")],
285
- outputs=gr.Plot(label="Generated Images"), title = "Stable Diffusion using Textual Inversion", description=description)
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)