Skip to content

Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)

Python

switch to flux 2 klein

Abi Rajaea90d6f343e4
diff --git a/backend/image_generation/core.py b/backend/image_generation/core.py
index 8ac9d35c..aada7eb8 100644
--- a/backend/image_generation/core.py
+++ b/backend/image_generation/core.py
@@ -54,14 +54,12 @@ async def generate_image_dalle(
async def generate_image_replicate(prompt: str, api_key: str) -> str:
- # We use Flux Schnell
+ # We use Flux 2 Klein
return await call_replicate(
{
"prompt": prompt,
- "num_outputs": 1,
"aspect_ratio": "1:1",
"output_format": "png",
- "output_quality": 100,
},
api_key,
)
diff --git a/backend/image_generation/replicate.py b/backend/image_generation/replicate.py
index 86dd6f1f..5905e42c 100644
--- a/backend/image_generation/replicate.py
+++ b/backend/image_generation/replicate.py
@@ -13,7 +13,7 @@ async def call_replicate(input: dict[str, str | int], api_token: str) -> str:
async with httpx.AsyncClient() as client:
try:
response = await client.post(
- "https://api.replicate.com/v1/models/black-forest-labs/flux-schnell/predictions",
+ "https://api.replicate.com/v1/models/black-forest-labs/flux-2-klein-4b/predictions",
headers=headers,
json=data,
)