Skip to content

controlnet_aux is required by the Annotator examples but is not in any install extra #1669

Description

@rakhimovv

The dependency set looks deliberately light, so this may be a documentation gap rather than a bug.

Setup: v2.1.6 at 4dbf980, fresh pip install -e ".[all]" into a clean Python 3.11 venv.

examples/qwen_image/model_inference/Qwen-Image-In-Context-Control-Union.py fails at the annotator:

File ".../diffsynth/utils/controlnet/annotator.py", line 28, in __init__
    from controlnet_aux.processor import OpenposeDetector
ModuleNotFoundError: No module named 'controlnet_aux'

annotator.py imports controlnet_aux seven times, one per detector, but I couldn't find it in pyproject.toml under [project.dependencies] or any extra, nor in README.md or docs/. Six example files construct an Annotator — four under examples/flux/ (FLEX.2-preview.py and FLUX.1-dev-Controlnet-Union-alpha.py, each in model_inference and model_inference_low_vram) and two under examples/qwen_image/ — so as far as I can tell none of them runs after pip install -e ".[all]".

The imports are inside __init__, so this only appears when Annotator is used; import diffsynth is unaffected.

After pip install controlnet_aux, the same script gets further and stops on a second missing package:

File ".../controlnet_aux/open_pose/util.py", line 127, in draw_handpose
    import matplotlib
ModuleNotFoundError: No module named 'matplotlib'

That one is controlnet_aux's own lazy import rather than anything here, but it's needed in practice for the openpose path. With both installed, both In-Context-Control-Union scripts run and produce output.

My question: would you like these declared, say a controlnet extra carrying controlnet_aux (and matplotlib) folded into all, or would you rather keep them out of the install and note them next to the ControlNet examples? I'm happy to send a PR once you've picked, since the naming and grouping are yours to decide; #1426 and #1349 looked like similar packaging questions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions