vladmandic / sd-extension-nudenet

NudeNet extension for SD.Next with customizable NSFW detection and auto-blur fetaures
MIT License
25 stars 5 forks source link

Issue only when using via API #4

Closed JohnnyStreet closed 1 year ago

JohnnyStreet commented 1 year ago

When using via Agent Scheduler API with the following settings:

settings.alwayson_scripts = {
  nudenet: {
    args: [
      true, true, 0.2, 3, ["female breast bare", "male penis", "female vagina", "anus bare"], "pixelate", ""
    ]
  }
}

The following error is produced and the image is returned uncensored:

EP Error D:\a\_work\1\s\onnxruntime\core\session\provider_bridge_ort.cc:1131 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 "" when trying to load "C:\git\automatic\venv\lib\site-packages\onnxruntime\capi\onnxruntime_providers_tensorrt.dll"
 when using ['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider']
Falling back to ['CUDAExecutionProvider', 'CPUExecutionProvider'] and retrying.

Maybe worth noting that I don't have a D:\a... path and am running this from C:\

vladmandic commented 1 year ago

reproduce the problem without being triggered via 3rd party. i cannot troubleshoot this. and error noted indicates issue with onnxruntime_providers_tensorrt, so i'd be really surprised if its different if used normally vs via agent-scheduler api.

JohnnyStreet commented 1 year ago

[SOLVED: "body parts" should be "body-parts" as it appears in the UI not as I copied it from the python script. Sorry for wasting your time!]

I have created a reproduction below using curl... [EDIT: fixed example in case anyone needs it as a reference]

{
  "enable_hr": false,
  "denoising_strength": 0,
  "prompt": "nude woman",
  "styles": [],
  "seed": -1,
  "batch_size": 1,
  "n_iter": 1,
  "steps": 30,
  "cfg_scale": 5.5,
  "width": 480,
  "height": 640,
  "restore_faces": false,
  "tiling": false,
  "negative_prompt": "",
  "override_settings": null,
  "override_settings_restore_afterwards": true,
  "script_args": [],
  "sampler_index": 0,
  "sampler_name": "Euler",
  "send_images": true,
  "save_images": true,
  "alwayson_scripts": {
    "nudenet": {
      "args": [
        true,
        true,
        0.2,
        3,
        [
          "female-breast-bare",
          "male-penis",
          "female-vagina",
          "anus-bare"
        ],
        "pixelate",
        ""
      ]
    }
  }
}
curl -X POST -H "Content-Type: application/json" -d @test.json http://localhost:7860/sdapi/v1/txt2img
vladmandic commented 1 year ago

no worries. note that nudenet extension just got updated so there are extra fields in the ui to set.