Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: API Examples and Documentation are broken due to pull #2847 #2920

Closed
1 task done
DrCyanide opened this issue May 20, 2024 · 0 comments · Fixed by #2921
Closed
1 task done

[Bug]: API Examples and Documentation are broken due to pull #2847 #2920

DrCyanide opened this issue May 20, 2024 · 0 comments · Fixed by #2921

Comments

@DrCyanide
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits of both this extension and the webui

What happened?

Pull request #2847 broke backwards compatibility with "control_mode": 0,, which is used in the examples.

It also broke the documentation at https://github.com/Mikubill/sd-webui-controlnet/wiki/API#controlnetunitrequest-json-object for what values are expected.

Steps to reproduce the problem

Try to run the example api code that's provided in this repo.

What should have happened?

The code should work, not return an error.

Commit where the problem happens

webui: 1c0a0c4
controlnet: 59c4349

What browsers do you use to access the UI ?

No response

Command Line Arguments

--api --listen --enable-insecure-extension-access

List of enabled extensions

image

Console logs

Running api_txt2img.py as is returns this:

Traceback (most recent call last):
  File "D:\Documents\AI\ImgGen\a1111_1.9.3\stable-diffusion-webui\extensions\sd-webui-controlnet\example\txt2img_example\api_txt2img.py", line 74, in <module>
    result = output['images'][0]
KeyError: 'images'

Modifying it to print(output) instead returns this:

{'error': 'ValidationError', 'detail': '', 'body': '', 'errors': "2 validation errors for ControlNetUnit\nresize_mode\n   (type=assertion_error)\ncontrol_mode\n  value is not a valid enumeration member; permitted: 'Balanced', 'My prompt is more important', 'ControlNet is more important' (type=type_error.enum; enum_values=[<ControlMode.BALANCED: 'Balanced'>, <ControlMode.PROMPT: 'My prompt is more important'>, <ControlMode.CONTROL: 'ControlNet is more important'>])"}


### Additional information

_No response_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant