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

Fix for controlnet(integrated)'s api #530

Closed
wants to merge 3 commits into from

Conversation

papuSpartan
Copy link

Description

Currently, sending an api request to controlnet integrated may result in issues. This is due to the base64 encoded images being accidentally left in base64 format. A check fails here because unit.image (and later unit.mask_image also) are always of type dict. The original comparison looks to be checking if contents are type str to infer if they are encoded. In practice, this fails without checking the image key for each which should actually contain the b64 image string.

May resolve: #439, #259, papuSpartan/stable-diffusion-webui-distributed#25

Checklist:

@papuSpartan papuSpartan requested a review from lllyasviel as a code owner March 10, 2024 09:15
@papuSpartan papuSpartan marked this pull request as draft March 10, 2024 09:56
@papuSpartan
Copy link
Author

Had a misunderstanding, unit formatting for the api should be like this per #162

{
  "controlnet": {
    "args": [
      {
        "image": "<base64string>",
        "image_mask": "<base64string>",
        ...
      },
      {
        "image": "<base64string>",
        "image_mask": "<base64string>",
        ...
      }
    ]
  }
}

unit.image: str is analogous to unit.input_image: str in mikubill's controlnet but I'm unsure as to why this was changed.

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 this pull request may close these issues.

[Bug]: SD difference (script) sd-webui-IS-NET-pro cannot input images to controlnet
1 participant