angtrim commited on
Commit
40c6354
1 Parent(s): 4cc3dfe

controlnet

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -18,10 +18,10 @@ pipe = StableDiffusionControlNetPipeline.from_pretrained(
18
 
19
 
20
  def genie (prompt, negative_prompt):
21
- generator = torch.Generator(device=device).seed()
22
  prompt = "photo of sks person, " + prompt
23
  centered = Image.open("centered.png").convert("RGB")
24
- images = pipe(prompt, controlnet_conditioning_scale=0.89, image=centered, negative_prompt=negative_prompt, width=512, height=512, num_inference_steps=20, guidance_scale=3.5, num_images_per_prompt=1, generator=generator).images[0]
25
  return images
26
 
27
  gr.Interface(fn=genie, inputs=[gr.Textbox(label='Descrivi la tua venere ideale (IN ENGLISH) ex: wearing sunglasses'), gr.Textbox(label='Descrivi cosa non vorresti vedere, (IN ENGLISH) ex: wearing hat')], outputs='image', title="Generatore di Venere", description="Genera la tua Venere! Scatena la tua fantsIA!").launch(debug=True, max_threads=True)
 
18
 
19
 
20
  def genie (prompt, negative_prompt):
21
+ generator = torch.Generator(device=device)
22
  prompt = "photo of sks person, " + prompt
23
  centered = Image.open("centered.png").convert("RGB")
24
+ images = pipe(prompt, controlnet_conditioning_scale=0.99, image=centered, negative_prompt=negative_prompt, width=512, height=512, num_inference_steps=20, guidance_scale=3.5, num_images_per_prompt=1).images[0]
25
  return images
26
 
27
  gr.Interface(fn=genie, inputs=[gr.Textbox(label='Descrivi la tua venere ideale (IN ENGLISH) ex: wearing sunglasses'), gr.Textbox(label='Descrivi cosa non vorresti vedere, (IN ENGLISH) ex: wearing hat')], outputs='image', title="Generatore di Venere", description="Genera la tua Venere! Scatena la tua fantsIA!").launch(debug=True, max_threads=True)