JoPmt commited on
Commit
42522ad
1 Parent(s): 8b9def7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -28,12 +28,12 @@ pipe = accelerator.prepare(KandinskyV22ControlnetPipeline.from_pretrained("kandi
28
  pipe = pipe.to("cpu")
29
  ##pipe.unet.to(memory_format=torch.channels_last)
30
  ##pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
31
- generator = torch.Generator(device="cpu").manual_seed(random.randint(-1, 2147483647))
32
 
33
  def plex(prompt,goof):
34
  goof = load_image(goof)
35
- ##goof = goof.convert("RGB")
36
- ##goof.thumbnail((512, 512))
37
  hint = make_hint(goof, depth_estimator).unsqueeze(0).to("cpu")
38
  negative_prior_prompt = "lowres,text,bad quality,jpeg artifacts,ugly,bad face,extra fingers,blurry,bad anatomy,extra limbs,fused fingers,long neck,watermark,signature"
39
  image_emb, zero_image_emb = pipe_prior(prompt=prompt, negative_prompt=negative_prior_prompt, generator=generator).to_tuple()
@@ -42,7 +42,7 @@ def plex(prompt,goof):
42
  image_embeds=image_emb,
43
  negative_image_embeds=zero_image_emb,
44
  hint=hint,
45
- num_inference_steps=50,
46
  generator=generator,
47
  height=512,
48
  width=512,
 
28
  pipe = pipe.to("cpu")
29
  ##pipe.unet.to(memory_format=torch.channels_last)
30
  ##pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
31
+ generator = torch.Generator(device="cpu").manual_seed(random.randint(-1, 47483647))
32
 
33
  def plex(prompt,goof):
34
  goof = load_image(goof)
35
+ goof = goof.convert("RGB")
36
+ goof.thumbnail((512, 512))
37
  hint = make_hint(goof, depth_estimator).unsqueeze(0).to("cpu")
38
  negative_prior_prompt = "lowres,text,bad quality,jpeg artifacts,ugly,bad face,extra fingers,blurry,bad anatomy,extra limbs,fused fingers,long neck,watermark,signature"
39
  image_emb, zero_image_emb = pipe_prior(prompt=prompt, negative_prompt=negative_prior_prompt, generator=generator).to_tuple()
 
42
  image_embeds=image_emb,
43
  negative_image_embeds=zero_image_emb,
44
  hint=hint,
45
+ num_inference_steps=20,
46
  generator=generator,
47
  height=512,
48
  width=512,