Manjushri commited on
Commit
b677c5f
1 Parent(s): 14d6aa9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -5,7 +5,7 @@ import modin.pandas as pd
5
  from PIL import Image
6
  from diffusers import DiffusionPipeline, StableDiffusionLatentUpscalePipeline
7
  import random
8
- random.seed(0)
9
  device = "cuda" if torch.cuda.is_available() else "cpu"
10
 
11
  pipe = DiffusionPipeline.from_pretrained("circulus/canvers-realistic-v3.6", torch_dtype=torch.float16, safety_checker=None)
@@ -18,6 +18,7 @@ upscaler.enable_xformers_memory_efficient_attention()
18
 
19
  def genie (Prompt, negative_prompt, height, width, scale, steps, Seed, upscale):
20
  generator = torch.manual_seed(Seed)
 
21
  if upscale == "Yes":
22
  image = pipe(Prompt, negative_prompt=negative_prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=scale, generator=generator).images[0]
23
  upscaled = upscaler(Prompt, negative_prompt=negative_prompt, image=image, num_inference_steps=5, guidance_scale=0, generator=generator).images[0]
 
5
  from PIL import Image
6
  from diffusers import DiffusionPipeline, StableDiffusionLatentUpscalePipeline
7
  import random
8
+
9
  device = "cuda" if torch.cuda.is_available() else "cpu"
10
 
11
  pipe = DiffusionPipeline.from_pretrained("circulus/canvers-realistic-v3.6", torch_dtype=torch.float16, safety_checker=None)
 
18
 
19
  def genie (Prompt, negative_prompt, height, width, scale, steps, Seed, upscale):
20
  generator = torch.manual_seed(Seed)
21
+ random.seed(0)
22
  if upscale == "Yes":
23
  image = pipe(Prompt, negative_prompt=negative_prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=scale, generator=generator).images[0]
24
  upscaled = upscaler(Prompt, negative_prompt=negative_prompt, image=image, num_inference_steps=5, guidance_scale=0, generator=generator).images[0]