Maria
commited on
Commit
·
11cde33
1
Parent(s):
cc64eff
hw6
Browse files
infer.py
CHANGED
@@ -179,9 +179,10 @@ def infer(
|
|
179 |
width,
|
180 |
height,
|
181 |
guidance_scale,
|
|
|
182 |
num_inference_steps,
|
183 |
use_controlnet,
|
184 |
-
|
185 |
controlnet_mode,
|
186 |
controlnet_image,
|
187 |
use_ip_adapter,
|
@@ -202,6 +203,7 @@ def infer(
|
|
202 |
prompt=prompt,
|
203 |
negative_prompt=negative_prompt,
|
204 |
guidance_scale=guidance_scale,
|
|
|
205 |
num_inference_steps=num_inference_steps,
|
206 |
width=width,
|
207 |
height=height,
|
@@ -217,9 +219,13 @@ def infer(
|
|
217 |
image = pipe(
|
218 |
prompt,
|
219 |
cn_image,
|
|
|
220 |
negative_prompt=negative_prompt,
|
221 |
-
|
222 |
-
|
|
|
|
|
|
|
223 |
generator=generator
|
224 |
).images[0]
|
225 |
|
@@ -231,9 +237,13 @@ def infer(
|
|
231 |
|
232 |
image = pipe(
|
233 |
prompt,
|
234 |
-
num_inference_steps=num_inference_steps,
|
235 |
-
guidance_scale=guidance_scale,
|
236 |
ip_adapter_image=ip_adapter_image,
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
generator=generator
|
238 |
).images[0]
|
239 |
|
@@ -248,13 +258,15 @@ def infer(
|
|
248 |
image = pipe(
|
249 |
prompt,
|
250 |
cn_image,
|
251 |
-
|
|
|
|
|
252 |
guidance_scale=guidance_scale,
|
253 |
-
|
|
|
254 |
width=width,
|
255 |
-
|
256 |
-
|
257 |
-
generator=generator,
|
258 |
).images[0]
|
259 |
|
260 |
return image, seed
|
|
|
179 |
width,
|
180 |
height,
|
181 |
guidance_scale,
|
182 |
+
lora_scale,
|
183 |
num_inference_steps,
|
184 |
use_controlnet,
|
185 |
+
control_strength,
|
186 |
controlnet_mode,
|
187 |
controlnet_image,
|
188 |
use_ip_adapter,
|
|
|
203 |
prompt=prompt,
|
204 |
negative_prompt=negative_prompt,
|
205 |
guidance_scale=guidance_scale,
|
206 |
+
cross_attention_kwargs={"scale": lora_scale},
|
207 |
num_inference_steps=num_inference_steps,
|
208 |
width=width,
|
209 |
height=height,
|
|
|
219 |
image = pipe(
|
220 |
prompt,
|
221 |
cn_image,
|
222 |
+
controlnet_conditioning_scale=control_strength,
|
223 |
negative_prompt=negative_prompt,
|
224 |
+
guidance_scale=guidance_scale,
|
225 |
+
cross_attention_kwargs={"scale": lora_scale},
|
226 |
+
num_inference_steps=num_inference_steps,
|
227 |
+
width=width,
|
228 |
+
height=height,
|
229 |
generator=generator
|
230 |
).images[0]
|
231 |
|
|
|
237 |
|
238 |
image = pipe(
|
239 |
prompt,
|
|
|
|
|
240 |
ip_adapter_image=ip_adapter_image,
|
241 |
+
negative_prompt=negative_prompt,
|
242 |
+
guidance_scale=guidance_scale,
|
243 |
+
cross_attention_kwargs={"scale": lora_scale},
|
244 |
+
num_inference_steps=num_inference_steps,
|
245 |
+
width=width,
|
246 |
+
height=height,
|
247 |
generator=generator
|
248 |
).images[0]
|
249 |
|
|
|
258 |
image = pipe(
|
259 |
prompt,
|
260 |
cn_image,
|
261 |
+
controlnet_conditioning_scale=control_strength,
|
262 |
+
ip_adapter_image=ip_adapter_image,
|
263 |
+
negative_prompt=negative_prompt,
|
264 |
guidance_scale=guidance_scale,
|
265 |
+
cross_attention_kwargs={"scale": lora_scale},
|
266 |
+
num_inference_steps=num_inference_steps,
|
267 |
width=width,
|
268 |
+
height=height,
|
269 |
+
generator=generator
|
|
|
270 |
).images[0]
|
271 |
|
272 |
return image, seed
|