From 3971c015624cff2de7ea74f98bf14c53797c0568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=CC=87brahim=20Su=CC=88ren?= Date: Wed, 3 Jul 2024 17:33:25 +0300 Subject: [PATCH] Return http 400 instead of 404 on invalid sampler --- modules/api/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/api/api.py b/modules/api/api.py index f468c3852..06cc854fb 100644 --- a/modules/api/api.py +++ b/modules/api/api.py @@ -43,7 +43,7 @@ def script_name_to_index(name, scripts): def validate_sampler_name(name): config = sd_samplers.all_samplers_map.get(name, None) if config is None: - raise HTTPException(status_code=404, detail="Sampler not found") + raise HTTPException(status_code=400, detail="Sampler not found") return name