From e14314f97f65d22316bf4093be519d072d5f0520 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Tue, 27 May 2025 18:21:03 -0700 Subject: [PATCH] Add safety filter to Kontext. --- comfy_api_nodes/nodes_bfl.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/comfy_api_nodes/nodes_bfl.py b/comfy_api_nodes/nodes_bfl.py index d431a5f71..494d5b992 100644 --- a/comfy_api_nodes/nodes_bfl.py +++ b/comfy_api_nodes/nodes_bfl.py @@ -329,6 +329,15 @@ class FluxKontextProImageNode(ComfyNodeABC): "tooltip": "The random seed used for creating the noise.", }, ), + "safety_tolerance": ( + IO.INT, + { + "default": 2, + "min": 0, + "max": 2, + "tooltip": "Safety tolerance for the image generation process", + }, + ), "prompt_upsampling": ( IO.BOOLEAN, { @@ -375,6 +384,7 @@ class FluxKontextProImageNode(ComfyNodeABC): input_image: torch.Tensor=None, seed=0, prompt_upsampling=False, + safety_tolerance=2, unique_id: Union[str, None] = None, **kwargs, ): @@ -382,7 +392,7 @@ class FluxKontextProImageNode(ComfyNodeABC): validate_string(prompt, strip_whitespace=False) operation = SynchronousOperation( endpoint=ApiEndpoint( - path="/proxy/bfl/flux-kontext-pro", + path="/proxy/bfl/flux-kontext-pro/generate", method=HttpMethod.POST, request_model=BFLFluxKontextProGenerateRequest, response_model=BFLFluxProGenerateResponse, @@ -405,6 +415,7 @@ class FluxKontextProImageNode(ComfyNodeABC): if input_image is None else convert_image_to_base64(input_image) ), + safety_tolerance=safety_tolerance, ), auth_kwargs=kwargs, )