angtrim commited on
Commit
4cc3dfe
1 Parent(s): 511d4a0

controlnet

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -18,11 +18,10 @@ pipe = StableDiffusionControlNetPipeline.from_pretrained(
18
 
19
 
20
  def genie (prompt, negative_prompt):
21
- generator = torch.Generator(device=device).manual_seed(-1)
22
  prompt = "photo of sks person, " + prompt
23
- negative_prompt = "nude, naked, tits, nsfw, " + negative_prompt
24
  centered = Image.open("centered.png").convert("RGB")
25
- images = pipe(prompt, controlnet_conditioning_scale=0.99, image=centered, negative_prompt=negative_prompt, width=512, height=512, num_inference_steps=25, guidance_scale=4.5, num_images_per_prompt=1, generator=generator).images[0]
26
  return images
27
 
28
  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).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)