Open edusachs opened 1 month ago
Hey, @edusachs! I'm here to help you with any bugs or questions you have. Let's work together to solve this issue.
To resolve the ValidationError
for ad_prompt
and ad_negative_prompt
when using the /sdapi/v1/txt2img
endpoint with the ADetailer extension, ensure that these fields are correctly formatted and included in your request payload. Here is an example of how to structure your payload:
{
"prompt": "amateur cellphone photography portrait photography of a woman in the office, wearing a black jacket, wearing a blue jeans, blonde hair, blue eyes, Nikon Z9 . f8.0, samsung galaxy, noise, jpeg artefacts, poor lighting, low light, underexposed, high contrast, <lora:detailed_hands:1.0>, hand, <lora:HandFineTuning_XL:1>, <lora:Perfect Hands:1>, perfect hands",
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, dark, cluttered, messy, unattractive, gloomy, distorted, watermark, logo, logotype, brand",
"seed": -1,
"sampler_name": "DPM++ 2M SDE",
"scheduler": "Karras",
"steps": 60,
"cfg_scale": 7.0,
"width": 832,
"height": 1216,
"restore_faces": false,
"vae": "sdxl_vae.safetensors",
"clip_skip": 1,
"alwayson_scripts": {
"ADetailer": {
"args": [
{
"ad_model": "hand_yolov8n.pt",
"ad_confidence": 0.3,
"ad_dilate_erode": 4,
"ad_mask_blur": 4,
"ad_denoising_strength": 0.4,
"ad_inpaint_only_masked": true,
"ad_prompt": "", // Add this field
"ad_negative_prompt": "" // Add this field
}
]
},
"reactor": {
"args": [
"<base64_image>",
true,
"0",
"0",
"I:\\\\stable-diffusion-webui\\\\models\\\\insightface\\\\inswapper_128.onnx",
"CodeFormer",
1,
true,
"4x_NMKD-Superscale-SP_178000_G",
1.5,
1,
false,
true,
1,
0,
0,
false,
1.0,
true,
false,
"CUDA",
true,
1,
"face-model-01.safetensors",
"I:\\\\StockMillionare\\\\01-generate-prompts\\\\faces-temp",
null,
false,
false,
0.5,
0
]
}
}
}
If you want to use the default prompts, you can leave ad_prompt
and ad_negative_prompt
as empty strings. According to the ADetailer documentation, if these fields are left blank, they will use the same prompts as the input [1][2][3].
To continue talking to Dosu, mention @dosu.
I specified the ad_prompt and ad_negative_prompt as requested, but the mentioned error is still occurring. Look at the payload:
{
"prompt": "amateur cellphone photography portrait photography of a woman in the office, wearing a black jacket, wearing a blue jeans, blonde hair, blue eyes, Nikon Z9 . f8.0, samsung galaxy, noise, jpeg artefacts, poor lighting, low light, underexposed, high contrast, <lora:detailed_hands:1.0>, hand, <lora:HandFineTuning_XL:1>, <lora:Perfect Hands:1>, perfect hands",
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, dark, cluttered, messy, unattractive, gloomy, distorted, watermark, logo, logotype, brand",
"seed": -1,
"sampler_name": "DPM++ 2M SDE",
"scheduler": "Karras",
"steps": 60,
"cfg_scale": 7.0,
"width": 832,
"height": 1216,
"restore_faces": false,
"vae": "sdxl_vae.safetensors",
"clip_skip": 1,
"alwayson_scripts": {
"ADetailer": {
"args": [
{
"ad_model": "hand_yolov8n.pt",
"ad_confidence": 0.3,
"ad_dilate_erode": 4,
"ad_mask_blur": 4,
"ad_denoising_strength": 0.4,
"ad_inpaint_only_masked": true,
"ad_prompt": "",
"ad_negative_prompt": ""
}
]
},
"reactor": {
"args": [
"<base64_image>",
true,
"0",
"0",
"I:\\\\stable-diffusion-webui\\\\models\\\\insightface\\\\inswapper_128.onnx",
"CodeFormer",
1,
true,
"4x_NMKD-Superscale-SP_178000_G",
1.5,
1,
false,
true,
1,
0,
0,
false,
1.0,
true,
false,
"CUDA",
true,
1,
"face-model-01.safetensors",
"I:\\\\StockMillionare\\\\01-generate-prompts\\\\faces-temp",
null,
false,
false,
0.5,
0
]
}
}
}
I am a layperson in programming, but with the help of ChatGPT, I added the lines below to the file adetailer\scripts\!adetailer.py
arg_dict['ad_prompt'] = arg_dict.get('ad_prompt', '') or '' arg_dict['ad_negative_prompt'] = arg_dict.get('ad_negative_prompt', '') or ''
See how it turned out; with this, the errors stopped occurring, and ADetailer started working again.
Hey,
I had the 3rd argument mentionned, but basically the same issue with ad_prompt and ad_negative_prompt. This solved my issue as well.
Thanks !🥂
Describe the bug
When using the "/sdapi/v1/txt2img" endpoint (API) of the stable-diffusion-webui-forge with ADetailer, I am encountering execution errors.
I am using the onnxruntime_gpu-1.17.0.dist-info; this was the only modification I made due to a new bug in Reactor.
The image is generated by Automatic1111, but without the modifications from ADetailer.
I have also attached the error images in this bug report.
The payload used is shown below.
Payload:
{ "prompt": "amateur cellphone photography portrait photography of a woman in the office, wearing a black jacket, wearing a blue jeans, blonde hair, blue eyes, Nikon Z9 . f8.0, samsung galaxy, noise, jpeg artefacts, poor lighting, low light, underexposed, high contrast,, hand, , , perfect hands",
"negative_prompt": "ugly, deformed, noisy, blurry, low contrast, dark, cluttered, messy, unattractive, gloomy, distorted, watermark, logo, logotype, brand",
"seed": -1,
"sampler_name": "DPM++ 2M SDE",
"scheduler": "Karras",
"steps": 60,
"cfg_scale": 7.0,
"width": 832,
"height": 1216,
"restore_faces": false,
"vae": "sdxl_vae.safetensors",
"clip_skip": 1,
"alwayson_scripts": {
"ADetailer": {
"args": [
{
"ad_model": "hand_yolov8n.pt",
"ad_confidence": 0.3,
"ad_dilate_erode": 4,
"ad_mask_blur": 4,
"ad_denoising_strength": 0.4,
"ad_inpaint_only_masked": true
}
]
},
"reactor": {
"args": [
"",
true,
"0",
"0",
"I:\\stable-diffusion-webui\\models\\insightface\\inswapper_128.onnx",
"CodeFormer",
1,
true,
"4x_NMKD-Superscale-SP_178000_G",
1.5,
1,
false,
true,
1,
0,
0,
false,
1.0,
true,
false,
"CUDA",
true,
1,
"face-model-01.safetensors",
"I:\\StockMillionare\\01-generate-prompts\\faces-temp",
null,
false,
false,
0.5,
0
]
}
}
}
Steps to reproduce
1 - Install the stable-diffusion-webui-forge version f1.0.2v1.10.1-previous-52-gaf0b04cc. 3 - Install the adetailer and reactor. 4 - Change the current version of onnxruntime_gpu to this one: onnxruntime_gpu-1.17.0.dist-info 2 - Use the /sdapi/v1/txt2img endpoint with the described payload.
Screenshots
Here is the sequence of images of the execution with the error (issue).
Console logs, from start to end.
List of installed extensions
adetailer https://github.com/Bing-su/adetailer.git main 25e7509f 2024-08-03 01:20:15 unknown
clip-interrogator-ext https://github.com/pharmapsychotic/clip-interrogator-ext.git main 0f1a4591 2023-09-09 22:35:46 unknown
sd-dynamic-prompts https://github.com/adieyal/sd-dynamic-prompts.git main de056ff8 2024-05-26 16:33:58 unknown
sd-webui-infinite-image-browsing https://github.com/zanllp/sd-webui-infinite-image-browsing.git main 19927f49 2024-07-27 01:01:30 unknown
sd-webui-reactor https://github.com/Gourieff/sd-webui-reactor.git main 613b7d74 2024-06-26 11:07:09 unknown
stable-diffusion-webui-rembg https://github.com/AUTOMATIC1111/stable-diffusion-webui-rembg.git master a4c07b85 2023-12-30 10:04:03 unknown
stable-diffusion-webui-wildcards https://github.com/AUTOMATIC1111/stable-diffusion-webui-wildcards.git master c7d49e18 2023-07-30 17:08:05 unknown