mattyamonaca commited on
Commit
2f108fa
1 Parent(s): 134c8c2
Files changed (1) hide show
  1. sd_model.py +8 -7
sd_model.py CHANGED
@@ -17,13 +17,6 @@ def get_cn_pipeline(reference_flg):
17
  "cagliostrolab/animagine-xl-3.1", controlnet=controlnets, vae=vae, torch_dtype=torch.float16
18
  )
19
 
20
- if reference_flg == True:
21
- pipe.load_ip_adapter(
22
- "h94/IP-Adapter",
23
- subfolder="sdxl_models",
24
- weight_name="ip-adapter-plus_sdxl_vit-h.bin"
25
- )
26
-
27
  return pipe
28
 
29
  def invert_image(img):
@@ -59,6 +52,7 @@ def generate(pipe, detectors, prompt, negative_prompt, reference_flg=False, refe
59
 
60
 
61
  if reference_flg==False:
 
62
  image = pipe(
63
  prompt=prompt,
64
  negative_prompt = negative_prompt,
@@ -67,6 +61,13 @@ def generate(pipe, detectors, prompt, negative_prompt, reference_flg=False, refe
67
  controlnet_conditioning_scale=[1.0, 0.2],
68
  ).images[0]
69
  else:
 
 
 
 
 
 
 
70
  image = pipe(
71
  prompt=prompt,
72
  negative_prompt = negative_prompt,
 
17
  "cagliostrolab/animagine-xl-3.1", controlnet=controlnets, vae=vae, torch_dtype=torch.float16
18
  )
19
 
 
 
 
 
 
 
 
20
  return pipe
21
 
22
  def invert_image(img):
 
52
 
53
 
54
  if reference_flg==False:
55
+ print("####False####")
56
  image = pipe(
57
  prompt=prompt,
58
  negative_prompt = negative_prompt,
 
61
  controlnet_conditioning_scale=[1.0, 0.2],
62
  ).images[0]
63
  else:
64
+ print("####True####")
65
+ print(reference_img)
66
+ pipe.load_ip_adapter(
67
+ "h94/IP-Adapter",
68
+ subfolder="sdxl_models",
69
+ weight_name="ip-adapter-plus_sdxl_vit-h.bin"
70
+ )
71
  image = pipe(
72
  prompt=prompt,
73
  negative_prompt = negative_prompt,