Manjushri commited on
Commit
14490c7
·
1 Parent(s): faae610

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -36,11 +36,10 @@ else:
36
 
37
  def genie (prompt, negative_prompt, height, width, scale, steps, seed, upscaling, prompt_2, negative_prompt_2, high_noise_frac):
38
  n_steps = 40
39
- high_noise_frac = 0.8
40
  generator = np.random.seed(0) if seed == 0 else torch.manual_seed(seed)
41
  int_image = pipe(prompt, prompt_2=prompt_2, negative_prompt=negative_prompt, negative_prompt_2=negative_prompt_2, num_inference_steps=steps, height=height, width=width, guidance_scale=scale, num_images_per_prompt=1, generator=generator, output_type="latent").images
42
  if upscaling == 'Yes':
43
- image = refiner(prompt=prompt, prompt_2=prompt_2, negative_prompt=negative_prompt, negative_prompt_2=negative_prompt_2, image=int_image).images[0]
44
  upscaled = upscaler(prompt=prompt, negative_prompt=negative_prompt, image=image, num_inference_steps=5, guidance_scale=0).images[0]
45
  torch.cuda.empty_cache()
46
  return (image, upscaled)
 
36
 
37
  def genie (prompt, negative_prompt, height, width, scale, steps, seed, upscaling, prompt_2, negative_prompt_2, high_noise_frac):
38
  n_steps = 40
 
39
  generator = np.random.seed(0) if seed == 0 else torch.manual_seed(seed)
40
  int_image = pipe(prompt, prompt_2=prompt_2, negative_prompt=negative_prompt, negative_prompt_2=negative_prompt_2, num_inference_steps=steps, height=height, width=width, guidance_scale=scale, num_images_per_prompt=1, generator=generator, output_type="latent").images
41
  if upscaling == 'Yes':
42
+ image = refiner(prompt=prompt, prompt_2=prompt_2, negative_prompt=negative_prompt, negative_prompt_2=negative_prompt_2, image=int_image, num_inference_steps=n_steps, denoising_start=high_noise_frac).images[0]
43
  upscaled = upscaler(prompt=prompt, negative_prompt=negative_prompt, image=image, num_inference_steps=5, guidance_scale=0).images[0]
44
  torch.cuda.empty_cache()
45
  return (image, upscaled)