mkthoma commited on
Commit
b4344d5
·
1 Parent(s): d8f0176

code update

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -48,7 +48,7 @@ images_with_loss = []
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 = 10 # Number of denoising steps
52
  guidance_scale = 7.5 # Scale for classifier-free guidance
53
  num_styles = len(style_files)
54
 
@@ -286,10 +286,10 @@ def image_generator_wrapper(prompt = "dog", loss_function=None):
286
 
287
  return image_generator(prompt, loss_function)
288
 
289
- description = "Generate an image with a prompt and apply vibrance loss if you wish to"
290
 
291
  demo = gr.Interface(image_generator,
292
  inputs=[gr.Textbox(label="Enter prompt for generation", type="text", value="dog sitting on a bench"),
293
  gr.Radio(["Yes", "No"], value="No" , label="Apply vibrance loss")],
294
- outputs=gr.Plot(label="Generated Images"), title = "Stable Diffusion", description=description)
295
  demo.launch()
 
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 = 1 # Number of denoising steps
52
  guidance_scale = 7.5 # Scale for classifier-free guidance
53
  num_styles = len(style_files)
54
 
 
286
 
287
  return image_generator(prompt, loss_function)
288
 
289
+ 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 the inference steps are reduced to 1 to produce results faster at the cost of accuracy of generated images."
290
 
291
  demo = gr.Interface(image_generator,
292
  inputs=[gr.Textbox(label="Enter prompt for generation", type="text", value="dog sitting on a bench"),
293
  gr.Radio(["Yes", "No"], value="No" , label="Apply vibrance loss")],
294
+ outputs=gr.Plot(label="Generated Images"), title = "Stable Diffusion using Textual Inversion", description=description)
295
  demo.launch()