From 89e096334dfb1049e8cb427a866739d934cd7ad8 Mon Sep 17 00:00:00 2001 From: hlohaus <983577+hlohaus@users.noreply.github.com> Date: Fri, 31 Jan 2025 17:36:48 +0100 Subject: Support reasoning tokens by default Add new default HuggingFace provider Add format_image_prompt and get_last_user_message helper Add stop_browser callable to get_nodriver function Fix content type response in images route --- g4f/Provider/hf_space/BlackForestLabsFlux1Schnell.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'g4f/Provider/hf_space/BlackForestLabsFlux1Schnell.py') diff --git a/g4f/Provider/hf_space/BlackForestLabsFlux1Schnell.py b/g4f/Provider/hf_space/BlackForestLabsFlux1Schnell.py index 11d2ee8e..2a1a2583 100644 --- a/g4f/Provider/hf_space/BlackForestLabsFlux1Schnell.py +++ b/g4f/Provider/hf_space/BlackForestLabsFlux1Schnell.py @@ -8,6 +8,7 @@ from ...image import ImageResponse from ...errors import ResponseError from ...requests.raise_for_status import raise_for_status from ..base_provider import AsyncGeneratorProvider, ProviderModelMixin +from ..helper import format_image_prompt class BlackForestLabsFlux1Schnell(AsyncGeneratorProvider, ProviderModelMixin): url = "https://black-forest-labs-flux-1-schnell.hf.space" @@ -42,7 +43,7 @@ class BlackForestLabsFlux1Schnell(AsyncGeneratorProvider, ProviderModelMixin): height = max(32, height - (height % 8)) if prompt is None: - prompt = messages[-1]["content"] + prompt = format_image_prompt(messages) payload = { "data": [ -- cgit v1.2.3