Spaces:
Runtime error
Runtime error
Update app.py
Browse filesTesting using refiner after upscaler instead, to denoise more
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 |
-
|
44 |
-
|
45 |
torch.cuda.empty_cache()
|
46 |
-
return (
|
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()
|