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

Drop unsupported args in ControlNet unit payload #13

Open
huchenlei opened this issue Dec 7, 2023 · 4 comments
Open

Drop unsupported args in ControlNet unit payload #13

huchenlei opened this issue Dec 7, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@huchenlei
Copy link
Owner

The ControlNet unit dumped by the extension are UiControlNetUnit instances, which contain a few extra parameters that are either not supported or not supposed to be used in API.

We should drop them so that they do not cause confusion.

These parameters include:

 is_ui: boolean;
 input_mode: number;
 batch_images: Array;
 output_dir: string;
 loopback: boolean;
@huchenlei huchenlei added the enhancement New feature or request label Dec 7, 2023
@huchenlei huchenlei self-assigned this Dec 7, 2023
@ZhuBoao
Copy link

ZhuBoao commented Mar 6, 2024

I am wonderrin is the payload in alwayson_scripts -> ControlNet actually working?
I have this following json copied from the ui

{
    "alwayson_scripts": {
        "API payload": {
            "args": []
        },
        "ControlNet": {
            "args": [
                {
                    "advanced_weighting": null,
                    "batch_images": "",
                    "control_mode": "Balanced",
                    "enabled": true,
                    "guidance_end": 1,
                    "guidance_start": 0,
                    "hr_option": "Both",
                    "image": {
                        "image": "base64image placeholder",
                        "mask": "base64image placeholder"
                    },
                    "inpaint_crop_input_image": false,
                    "input_mode": "simple",
                    "is_ui": true,
                    "loopback": false,
                    "low_vram": false,
                    "model": "ip-adapter-faceid-plusv2_sd15 [6e14fc1a]",
                    "module": "ip-adapter_face_id_plus",
                    "output_dir": "",
                    "pixel_perfect": false,
                    "processor_res": 512,
                    "resize_mode": "Crop and Resize",
                    "save_detected_map": true,
                    "threshold_a": -1,
                    "threshold_b": -1,
                    "weight": 1
                },
                {
                    "advanced_weighting": null,
                    "batch_images": "",
                    "control_mode": "Balanced",
                    "enabled": false,
                    "guidance_end": 1,
                    "guidance_start": 0,
                    "hr_option": "Both",
                    "image": null,
                    "inpaint_crop_input_image": false,
                    "input_mode": "simple",
                    "is_ui": true,
                    "loopback": false,
                    "low_vram": false,
                    "model": "None",
                    "module": "none",
                    "output_dir": "",
                    "pixel_perfect": false,
                    "processor_res": -1,
                    "resize_mode": "Crop and Resize",
                    "save_detected_map": true,
                    "threshold_a": -1,
                    "threshold_b": -1,
                    "weight": 1
                },
                {
                    "advanced_weighting": null,
                    "batch_images": "",
                    "control_mode": "Balanced",
                    "enabled": false,
                    "guidance_end": 1,
                    "guidance_start": 0,
                    "hr_option": "Both",
                    "image": null,
                    "inpaint_crop_input_image": false,
                    "input_mode": "simple",
                    "is_ui": true,
                    "loopback": false,
                    "low_vram": false,
                    "model": "None",
                    "module": "none",
                    "output_dir": "",
                    "pixel_perfect": false,
                    "processor_res": -1,
                    "resize_mode": "Crop and Resize",
                    "save_detected_map": true,
                    "threshold_a": -1,
                    "threshold_b": -1,
                    "weight": 1
                }
            ]
        },
        "Extra options": {
            "args": []
        },
        "Hypertile": {
            "args": []
        },
        "Refiner": {
            "args": [
                false,
                "",
                0.8
            ]
        },
        "Regional Prompter": {
            "args": [
                false,
                false,
                "Matrix",
                "Columns",
                "Mask",
                "Prompt",
                "1,1",
                "0.2",
                false,
                false,
                false,
                "Attention",
                [
                    false
                ],
                "0",
                "0",
                "0.4",
                null,
                "0",
                "0",
                false
            ]
        },
        "Seed": {
            "args": [
                -1,
                false,
                -1,
                0,
                0,
                0
            ]
        }
    },
    "batch_size": 1,
    "cfg_scale": 7,
    "comments": {},
    "disable_extra_networks": false,
    "do_not_save_grid": false,
    "do_not_save_samples": false,
    "enable_hr": false,
    "height": 512,
    "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": "disfigure, deformed, ugly",
    "override_settings": {},
    "override_settings_restore_afterwards": true,
    "prompt": "A woman in office, white professional shirt <lora:ip-adapter-faceid-plusv2_sd15_lora:1>",
    "restore_faces": false,
    "s_churn": 0.0,
    "s_min_uncond": 0.0,
    "s_noise": 1.0,
    "s_tmax": null,
    "s_tmin": 0.0,
    "sampler_name": "DPM++ 2M Karras",
    "script_args": [],
    "script_name": null,
    "seed": -1,
    "seed_enable_extras": true,
    "seed_resize_from_h": -1,
    "seed_resize_from_w": -1,
    "steps": 20,
    "styles": [],
    "subseed": -1,
    "subseed_strength": 0,
    "tiling": false,
    "width": 512
}

But even if I paste the encoded base64 image to base64image placeholder, the response still seems to be not applying ControlNet.
Is something wrong on my side?

--------------------update ----------------------------------------
Guess I've found the issue
instead of
"image": {
"image": "base64image placeholder",
"mask": "base64image placeholder"
}
I directly put base64 image to the first level image object.
"image": ”base64image“

and got correct response from API.

Is it a potential bug? @huchenlei I suppose the copied json should be the correct format

Thank you for the great work on this extension btw. Really helpful!

@huchenlei
Copy link
Owner Author

Wield. In sd-webui-controlnet, both should work. In SD Forge,

"image": {
"image": "base64image placeholder",
"mask": "base64image placeholder"
}

probably won't work. Can you confirm which UI you are using?

@ZhuBoao
Copy link

ZhuBoao commented Mar 7, 2024

Wield. In sd-webui-controlnet, both should work. In SD Forge,

"image": {
"image": "base64image placeholder",
"mask": "base64image placeholder"
}

probably won't work. Can you confirm which UI you are using?

I am using the latest automatic1111 on Window 11, with sd-webui-controlnet extension installed

@YuxuanWang0822
Copy link

Hi, same problem, did you solve it?

Wield. In sd-webui-controlnet, both should work. In SD Forge,

"image": {
"image": "base64image placeholder",
"mask": "base64image placeholder"
}

probably won't work. Can you confirm which UI you are using?

I am using the latest automatic1111 on Window 11, with sd-webui-controlnet extension installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants