AkashDataScience commited on
Commit
4724ce5
·
1 Parent(s): b36e2f1

Updating defaults

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -221,7 +221,7 @@ def generate_with_guide_loss(num_inference_steps, guidance_scale, seed, text_inp
221
  noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond)
222
 
223
  #### ADDITIONAL GUIDANCE ###
224
- if i%3 == 0:
225
  # Requires grad on the latents
226
  latents = latents.detach().requires_grad_()
227
 
@@ -277,17 +277,15 @@ def inference(text, style, inference_step, guidance_scale, seed, guidance_method
277
 
278
  title = "Stable Diffusion with Textual Inversion"
279
  description = "A simple Gradio interface to infer Stable Diffusion and generate images with different art style"
280
- examples = [["A sweet potato farm", 'Concept', 6, 1.5, 1, 'Grayscale', 100],
281
- ["Sky full of cotton candy", 'Realistic', 6, 3.5, 2, 'Bright', 200],
282
- ["Kittens in the bathtub", 'Line', 6, 5.5, 3, 'Contrast', 300],
283
- ["Water skiing on a lake", 'Ricky', 6, 7.5, 4, 'Symmetry', 400],
284
- ["Miniature pet elephant", 'Plane Scape', 6, 9.5, 5, 'Saturation', 500]]
285
 
286
  demo = gr.Interface(inference,
287
  inputs = [gr.Textbox(label="Prompt", type="text"),
288
  gr.Dropdown(label="Style", choices=['Concept', 'Realistic', 'Line',
289
  'Ricky', 'Plane Scape'], value="Concept"),
290
- gr.Slider(10, 30, 6, step = 1, label="Inference steps"),
291
  gr.Slider(1, 10, 7.5, step = 0.1, label="Guidance scale"),
292
  gr.Slider(0, 10000, 1, step = 1, label="Seed"),
293
  gr.Dropdown(label="Guidance method", choices=['Grayscale', 'Bright', 'Contrast',
 
221
  noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_text - noise_pred_uncond)
222
 
223
  #### ADDITIONAL GUIDANCE ###
224
+ if i%5 == 0:
225
  # Requires grad on the latents
226
  latents = latents.detach().requires_grad_()
227
 
 
277
 
278
  title = "Stable Diffusion with Textual Inversion"
279
  description = "A simple Gradio interface to infer Stable Diffusion and generate images with different art style"
280
+ examples = [["A sweet potato farm", 'Concept', 10, 1.5, 1, 'Grayscale', 100],
281
+ ["Sky full of cotton candy", 'Realistic', 10, 3.5, 2, 'Bright', 200],
282
+ ["Kittens in the bathtub", 'Line', 10, 5.5, 3, 'Contrast', 300]]
 
 
283
 
284
  demo = gr.Interface(inference,
285
  inputs = [gr.Textbox(label="Prompt", type="text"),
286
  gr.Dropdown(label="Style", choices=['Concept', 'Realistic', 'Line',
287
  'Ricky', 'Plane Scape'], value="Concept"),
288
+ gr.Slider(10, 30, 10, step = 1, label="Inference steps"),
289
  gr.Slider(1, 10, 7.5, step = 0.1, label="Guidance scale"),
290
  gr.Slider(0, 10000, 1, step = 1, label="Seed"),
291
  gr.Dropdown(label="Guidance method", choices=['Grayscale', 'Bright', 'Contrast',