LPX55 commited on
Commit
f27ea3a
·
verified ·
1 Parent(s): 657cb4e

Update raw.py

Browse files
Files changed (1) hide show
  1. raw.py +5 -3
raw.py CHANGED
@@ -20,17 +20,17 @@ pipe = FluxControlNetPipeline.from_pretrained(
20
  pipe.to("cuda")
21
 
22
  @spaces.GPU
23
- def generate_image(prompt, control_image):
24
  # Load control image
25
  control_image = load_image(control_image)
26
  w, h = control_image.size
27
  # Upscale x1
28
- control_image = control_image.resize((w * 1, h * 1))
29
  image = pipe(
30
  prompt=prompt,
31
  control_image=control_image,
32
  controlnet_conditioning_scale=0.6,
33
- num_inference_steps=8,
34
  guidance_scale=3.5,
35
  height=control_image.size[1],
36
  width=control_image.size[0]
@@ -42,6 +42,8 @@ iface = gr.Interface(
42
  fn=generate_image,
43
  inputs=[
44
  gr.Textbox(lines=2, placeholder="Enter your prompt here..."),
 
 
45
  gr.Image(type="pil", label="Control Image"),
46
  ],
47
  outputs=[
 
20
  pipe.to("cuda")
21
 
22
  @spaces.GPU
23
+ def generate_image(prompt, scale, steps, control_image):
24
  # Load control image
25
  control_image = load_image(control_image)
26
  w, h = control_image.size
27
  # Upscale x1
28
+ control_image = control_image.resize((w * scale, h * scale))
29
  image = pipe(
30
  prompt=prompt,
31
  control_image=control_image,
32
  controlnet_conditioning_scale=0.6,
33
+ num_inference_steps=steps,
34
  guidance_scale=3.5,
35
  height=control_image.size[1],
36
  width=control_image.size[0]
 
42
  fn=generate_image,
43
  inputs=[
44
  gr.Textbox(lines=2, placeholder="Enter your prompt here..."),
45
+ gr.Slider(1, 3, value=1, label="Scale"),
46
+ gr.Slider(6, 30, value=8, label="Steps"),
47
  gr.Image(type="pil", label="Control Image"),
48
  ],
49
  outputs=[