From 31c54ff0684e3c7eeb7d8ccfa98fb34722f8edf6 Mon Sep 17 00:00:00 2001 From: Will Miao Date: Sat, 16 May 2026 20:15:03 +0800 Subject: [PATCH] fix(civitai): add nsfw param to user-models and batch-ids queries (#930) The CivitAI /api/v1/models endpoint defaults to filtering out NSFW content when the nsfw query parameter is omitted. Both get_user_models() and get_model_versions_bulk() hit this endpoint without passing nsfw=true, causing models whose nsfwLevel doesn't include the PG bit to be silently dropped from results. Add nsfw=true to both call sites so all browsing levels are returned. --- py/services/civitai_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/services/civitai_client.py b/py/services/civitai_client.py index 3d088b72..65178cd9 100644 --- a/py/services/civitai_client.py +++ b/py/services/civitai_client.py @@ -257,7 +257,7 @@ class CivitaiClient: "GET", f"{self.base_url}/models", use_auth=True, - params={"ids": query}, + params={"ids": query, "nsfw": "true"}, ) if not success: return None @@ -640,7 +640,7 @@ class CivitaiClient: "GET", f"{self.base_url}/models", use_auth=True, - params={"username": username}, + params={"username": username, "nsfw": "true"}, ) if not success: