s9roll7 / animatediff-cli-prompt-travel

animatediff prompt travel
Apache License 2.0
1.19k stars 104 forks source link

Controlnet reference issue #116

Closed alanhuang67 closed 1 year ago

alanhuang67 commented 1 year ago

Hello,

I'm trying to use controlnet reference, it comes this error message, but other controlnet worked well:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ D:\animatediff-cli-prompt-travel\src\animatediff\cli.py:316 in generate │ │ │ │ 313 │ save_dir.mkdir(parents=True, exist_ok=True) │ │ 314 │ logger.info(f"Will save outputs to ./{path_from_cwd(save_dir)}") │ │ 315 │ │ │ ❱ 316 │ controlnet_image_map, controlnet_type_map, controlnet_ref_map = controlnet_preproces │ │ 317 │ ip_adapter_map = ip_adapter_preprocess(model_config.ip_adapter_map, width, height, l │ │ 318 │ │ │ 319 │ # beware the pipeline │ │ │ │ D:\animatediff-cli-prompt-travel\src\animatediff\generate.py:680 in controlnet_preprocess │ │ │ │ 677 │ │ │ │ │ "gn_auto_machine_weight" : r["gn_auto_machine_weight"], │ │ 678 │ │ │ │ │ "reference_attn" : r["reference_attn"], │ │ 679 │ │ │ │ │ "reference_adain" : r["reference_adain"], │ │ ❱ 680 │ │ │ │ │ "scale_pattern" : r["scale_pattern"] │ │ 681 │ │ │ │ } │ │ 682 │ │ │ │ │ │ 683 │ │ │ │ if save_detectmap: │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ KeyError: 'scale_pattern'

My code below:

    "controlnet_ref": { 
          "enable": true,
          "use_frame_as_ref_image": false,
          "use_1st_frame_as_ref_image": true,
          "ref_image": "ref_image/STB.png",
          "attention_auto_machine_weight": 1.0,
          "gn_auto_machine_weight": 1.0,
          "style_fidelity": 0.3,
          "reference_attn": true,
          "reference_adain": false
    }

is there anything I'm sitting wrong? Thanks

alanhuang67 commented 1 year ago

I fix it, lost a sitting

"scale_pattern":[0.5]