Closed JohnnyStreet closed 1 year ago
Please update to the latest version if you can - the issue you're facing (similar to #91) has been rectified there. Hope this helps!
@artventuredev updating did not solve it but I was able to get it working using "ControlNet" instead of "controlnet". I am still trying to figure out the formatting for other scripts, for example "face editor ex".
I have tried things like "FaceEditorEx" but I can not figure it out. I did also notice in your api.py you have this:
# remove unused args to reduce payload size
named_args.pop("alwayson_scripts", None)
Digging a little further, it seems you are not using lower case at this point and also you are filtering out which scripts are valid, only approving certain ones apparently. Is there a reason for not just passing the full alwayson_scripts value from the user?
assert type(alwayson_scripts) is dict
for script in alwayson_scripts:
if script not in valid_alwayson_scripts:
# allow controlnet
if script == "ControlNet":
script_args = get_dict_attribute(
alwayson_scripts, f"{script}.args", None
)
if script_args:
arg_list = map_named_script_args_to_list(script, script_args)
valid_alwayson_scripts[script] = {"args": arg_list}
else:
print(
f"Warning: script {script} is not in script_runner.alwayson_scripts"
)
# print args
print(alwayson_scripts[script])
params["alwayson_scripts"] = valid_alwayson_scripts
FIXED BY BYPASSING ALL OF THIS:
# check if alwayson_scripts has script that is not in script_runner.alwayson_scripts
#
#assert type(alwayson_scripts) is dict
#for script in alwayson_scripts:
# if script not in valid_alwayson_scripts:
# # allow controlnet
# if script == "ControlNet":
# script_args = get_dict_attribute(
# alwayson_scripts, f"{script}.args", None
# )
# if script_args:
# arg_list = map_named_script_args_to_list(script, script_args)
# valid_alwayson_scripts[script] = {"args": arg_list}
# else:
# print(
# f"Warning: script {script} is not in script_runner.alwayson_scripts"
# )
# # print args
# print(alwayson_scripts[script])
#
# params["alwayson_scripts"] = valid_alwayson_scripts
params["alwayson_scripts"] = alwayson_scripts
Hmm, my bad. Both upper and lower case for the script title should be allowed. For now, you need to enter the correct case. I'll make a fix for this soon.
To get the correct script name, you need to read the code of the extension. It's the title
of the Script
class. In your case, it's Face Editor EX
. Please note, however, that even with the next update, the allowed values can be face editor ex
, Face Editor EX
, or face Editor ex
, but NOT FaceEditorEx
the allowed values can be
face editor ex
,Face Editor EX
, orface Editor ex
, but NOTFaceEditorEx
I am pretty sure I tried all of these. I have always used "face editor ex" outside of agent scheduler. It really needs to allow the same settings to be passed as they would directly to the API because there are lots of existing examples that show them in lowercase. I know it's tedious to fix but imagine how we feel having to guess or look up each extension name in their code to make sure we didn't type Ex instead of EX or something. I appreciate you taking the time to address it.
@JohnnyStreet The issue should be fixed in the latest update, please give it a try.
@artventuredev Fantastic, thank you so much!
@JohnnyStreet There was a mistake in the previous commit, so please update one more time.
@artventuredev太棒了,非常感谢!
Can it be used correctly now?When I use alwayson_scripts: { controlnet: {args: [ { enabled: true, image: base64}]}} will report an error “string indices must be integers”?
Here's a working example with ControlNet
:
{
"prompt": "1girl",
"negative_prompt": "EasyNegative",
"alwayson_scripts": {
"controlnet": {
"args": [
{
"enabled": true,
"image": {
"image": "https://d2lae7oxvyyfdd.cloudfront.net/poses/5609.jpeg"
},
"model": "control_v11p_sd15_openpose [cab727d4]"
}
]
}
}
}
The image
field should be a Dict
with "image"
and an optional "mask"
. You can use URL or base64 for image and mask.
来件收到辣收到辣╰( ̄▽ ̄)╮
I can't seem to get any scripts to work in sd-webui-agent-scheduler using the same alwayson_scripts settings I use directly with the API.