Manjushri commited on
Commit
495a8c0
·
1 Parent(s): 68645db

Update app.py

Browse files

Testing using refiner after upscaler instead, to denoise more

Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -40,10 +40,10 @@ def genie (prompt, negative_prompt, height, width, scale, steps, seed, upscaling
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)
47
  else:
48
  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]
49
  torch.cuda.empty_cache()
 
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
+ upscaled = upscaler(prompt=prompt, negative_prompt=negative_prompt, image=int_image, num_inference_steps=5, guidance_scale=0).images[0]
44
+ image = refiner(prompt=prompt, prompt_2=prompt_2, negative_prompt=negative_prompt, negative_prompt_2=negative_prompt_2, image=upscaled).images[0]
45
  torch.cuda.empty_cache()
46
+ return (upscaled, image)
47
  else:
48
  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]
49
  torch.cuda.empty_cache()