lllyasviel / lllyasviel/ControlNet

OpenPose only works about 50% of the time

Open
#585 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
34.1k
Forks
3k
PR merge metrics
No merged PRs in 30d

Description

Ever since upgrading to Stable Diffusion XL, it's very difficult to get the OpenPose functionality to work. I'd say it only works for me about 50% of the time. There are times when it seems to fail completely - the OpenPose input image that's returned with the generated images is totally black. Other times, I do see the keypoints in the OpenPose input image that's returned with the generated images, but the OpenPose data was totally ignored.

I don't know if this is a problem with the XL OpenPose models people have trained for ControlNet, or a problem with ControlNet itself.

Here is an example of the 2nd case:

I'm using two LoRA models (a character and a style), but OpenPose will sometimes refuse to work even if I'm not using LoRA models.

API request body:

```
{
"alwayson_scripts": {
"API payload": {
"args": []
},
"ControlNet": {
"args": [
{
"batch_images": "",
"control_mode": "Balanced",
"enabled": true,
"guidance_end": 1,
"guidance_start": 0,
"image": {
"image": "long string"
},
"input_mode": "simple",
"is_ui": true,
"loopback": false,
"low_vram": true,
"model": "kohya_controllllite_xl_openpose_anime_v2 [b0fa10bb]",
"module": "openpose",
"output_dir": "",
"pixel_perfect": true,
"processor_res": 512,
"resize_mode": "Crop and Resize",
"save_detected_map": true,
"threshold_a": -1,
"threshold_b": -1,
"weight": 1
},
]
},
},
"batch_size": 4,
"cfg_scale": 7,
"comments": {},
"disable_extra_networks": false,
"do_not_save_grid": false,
"do_not_save_samples": false,
"enable_hr": false,
"height": 1024,
"hr_negative_prompt": "",
"hr_prompt": "",
"hr_resize_x": 0,
"hr_resize_y": 0,
"hr_scale": 2,
"hr_second_pass_steps": 0,
"hr_upscaler": "Latent",
"n_iter": 1,
"negative_prompt": "",
"override_settings": {},
"override_settings_restore_afterwards": true,
"prompt": " keqing (genshin impact),purple eyes,purple hair,twintails, hair ornament,bare shoulders,dress,hair bun,detached sleeves, ",
"restore_faces": false,
"s_churn": 0.0,
"s_min_uncond": 0,
"s_noise": 1.0,
"s_tmax": null,
"s_tmin": 0.0,
"sampler_name": "DPM++ 3M SDE Exponential",
"script_args": [],
"script_name": null,
"seed": -1,
"seed_enable_extras": true,
"seed_resize_from_h": -1,
"seed_resize_from_w": -1,
"steps": 50,
"styles": [],
"subseed": -1,
"subseed_strength": 0,
"tiling": false,
"width": 1024
}
```

The generation settings:
```
keqing (genshin impact),purple eyes,purple hair,twintails, hair ornament,bare shoulders,dress,hair bun,detached sleeves,
Steps: 50, Sampler: DPM++ 3M SDE Exponential, CFG scale: 7, Seed: 610591763, Size: 1024x1024, Model hash: 31e35c80fc, Model: sd_xl_base_1.0, VAE hash: 235745af8d, VAE: sdxl_vae.safetensors, ControlNet 0: "Module: openpose, Model: kohya_controllllite_xl_openpose_anime_v2 [b0fa10bb], Weight: 1, Resize Mode: Crop and Resize, Low Vram: True, Processor Res: 512, Guidance Start: 0, Guidance End: 1, Pixel Perfect: True, Control Mode: Balanced, Save Detected Map: True", Lora hashes: "keqing3: cba586b84494, sdxl: 2fc5967b49c2", Version: v1.6.0-1-g0562456f
```

The relevant API logs, which never show any errors:
```
Nov 25 06:14:53 ip-172-31-42-185.eu-north-1.compute.internal bash[5578]: 2023-11-25 06:14:53,503 - ControlNet - INFO - Loading model from cache: kohya_controllllite_xl_openpose_anime_v2 [b0fa10bb]
Nov 25 06:14:53 ip-172-31-42-185.eu-north-1.compute.internal bash[5578]: 2023-11-25 06:14:53,504 - ControlNet - INFO - Loading preprocessor: openpose
Nov 25 06:14:53 ip-172-31-42-185.eu-north-1.compute.internal bash[5578]: 2023-11-25 06:14:53,504 - ControlNet - INFO - preprocessor resolution = 1024
Nov 25 06:14:53 ip-172-31-42-185.eu-north-1.compute.internal bash[5578]: 2023-11-25 06:14:53,553 - ControlNet - INFO - ControlNet Hooked - Time = 0.21093463897705078

```

The response:
![openpose_skeleton](https://github.com/lllyasviel/ControlNet/assets/11196050/491aa709-23fd-441e-8d34-482ac97a4504)
![grid-0001](https://github.com/lllyasviel/ControlNet/assets/11196050/639e4a4d-54f6-4664-8c86-49474e314d04)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the supplied API request with the listed SDXL, ControlNet, and OpenPose settings, then compare the returned OpenPose input image with the generated images and the ControlNet API logs. Done means determining why the detector sometimes returns a black map or why detected keypoints are ignored, with a reproducible failure or verified fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, computer-vision, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.