Vanisper commited on
Commit
8af6e20
·
1 Parent(s): 49a7fff

fix: 修复缺少的call参数

Browse files
Files changed (2) hide show
  1. app.py +6 -2
  2. utils.py +1 -1
app.py CHANGED
@@ -408,7 +408,9 @@ class Demo:
408
  num_inference_steps=self.num_inference_steps,
409
  generator=generator,
410
  networks=networks, # 加载多个 LoRA 模型
 
411
  scales=scale_list, # 设置每个 LoRA 的权重
 
412
  guidance_scale=self.guidance_scale
413
  ).images[0]
414
 
@@ -419,8 +421,10 @@ class Demo:
419
  num_images_per_prompt=1,
420
  num_inference_steps=self.num_inference_steps,
421
  generator=generator,
422
- networks=[], # 不加载任何 LoRA 模型
423
- scales=[], # 不设置任何权重
 
 
424
  guidance_scale=self.guidance_scale
425
  ).images[0]
426
 
 
408
  num_inference_steps=self.num_inference_steps,
409
  generator=generator,
410
  networks=networks, # 加载多个 LoRA 模型
411
+ start_noise=int(start_noise),
412
  scales=scale_list, # 设置每个 LoRA 的权重
413
+ unet=unet,
414
  guidance_scale=self.guidance_scale
415
  ).images[0]
416
 
 
421
  num_images_per_prompt=1,
422
  num_inference_steps=self.num_inference_steps,
423
  generator=generator,
424
+ networks=networks,
425
+ start_noise=int(start_noise),
426
+ scales=[0] * len(networks), # 不设置任何权重
427
+ unet=unet,
428
  guidance_scale=self.guidance_scale
429
  ).images[0]
430
 
utils.py CHANGED
@@ -333,7 +333,7 @@ def call(
333
  if networks is not None and scales is not None:
334
  for _network, _scale in zip(networks, scales):
335
  with _network:
336
- _network.set_lora_slider(scale=0 if t > start_noise else _scale)
337
 
338
  # expand the latents if we are doing classifier free guidance
339
  latent_model_input = torch.cat([latents] * 2) if do_classifier_free_guidance else latents
 
333
  if networks is not None and scales is not None:
334
  for _network, _scale in zip(networks, scales):
335
  with _network:
336
+ _network.set_lora_slider(scale=0 if t > start_noise else float(_scale))
337
 
338
  # expand the latents if we are doing classifier free guidance
339
  latent_model_input = torch.cat([latents] * 2) if do_classifier_free_guidance else latents