dvir-bria commited on
Commit
f817fc9
1 Parent(s): 7497bf5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -11
app.py CHANGED
@@ -11,6 +11,7 @@ controlnet = ControlNetModel.from_pretrained(
11
  "briaai/ControlNet-Canny",
12
  torch_dtype=torch.float16
13
  )
 
14
 
15
  pipe = StableDiffusionXLControlNetPipeline.from_pretrained(
16
  "briaai/BRIA-2.0",
@@ -52,17 +53,11 @@ def process(input_image, prompt, negative_prompt, num_steps, controlnet_conditio
52
  canny_image = get_canny_filter(input_image)
53
 
54
  pipe.enable_freeu(b1=1.1, b2=1.1, s1=0.5, s2=0.7)
55
-
56
- if negative_prompt != '':
57
- images = pipe(
58
- prompt, negative_prompt=negative_prompt, image=canny_image, num_inference_steps=num_steps, controlnet_conditioning_scale=float(controlnet_conditioning_scale),
59
- generator=generator,
60
- ).images
61
- else:
62
- images = pipe(
63
- prompt, force_zeros_for_empty_prompt=False, image=canny_image, num_inference_steps=num_steps, controlnet_conditioning_scale=float(controlnet_conditioning_scale),
64
- generator=generator,
65
- ).images
66
 
67
  return [canny_image,images[0]]
68
 
 
11
  "briaai/ControlNet-Canny",
12
  torch_dtype=torch.float16
13
  )
14
+ # force_zeros_for_empty_prompt=False
15
 
16
  pipe = StableDiffusionXLControlNetPipeline.from_pretrained(
17
  "briaai/BRIA-2.0",
 
53
  canny_image = get_canny_filter(input_image)
54
 
55
  pipe.enable_freeu(b1=1.1, b2=1.1, s1=0.5, s2=0.7)
56
+
57
+ images = pipe(
58
+ prompt, negative_prompt=negative_prompt, image=canny_image, num_inference_steps=num_steps, controlnet_conditioning_scale=float(controlnet_conditioning_scale),
59
+ generator=generator,
60
+ ).images
 
 
 
 
 
 
61
 
62
  return [canny_image,images[0]]
63