Merge pull request #2792 from nazdridoy/ARTA-fix-and-add-seed

fix: ARTA model and add optional seed parameter
This commit is contained in:
H Lohaus 2025-03-12 08:00:06 +01:00 committed by GitHub
commit 2795861341
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,6 +3,7 @@ from __future__ import annotations
import os
import time
import json
import random
from pathlib import Path
from aiohttp import ClientSession
import asyncio
@ -72,7 +73,7 @@ class ARTA(AsyncGeneratorProvider, ProviderModelMixin):
"kawaii": "Kawaii",
"cinematic_art": "Cinematic Art",
"professional": "Professional",
"flux_black_ink": "Flux Black Ink"
"black_ink": "Black Ink"
}
image_models = [*model_aliases.keys()]
models = image_models
@ -135,11 +136,16 @@ class ARTA(AsyncGeneratorProvider, ProviderModelMixin):
guidance_scale: int = 7,
num_inference_steps: int = 30,
aspect_ratio: str = "1:1",
seed: int = None,
**kwargs
) -> AsyncResult:
model = cls.get_model(model)
prompt = format_image_prompt(messages, prompt)
# Generate a random seed if not provided
if seed is None:
seed = random.randint(9999, 99999999) # Common range for random seeds
# Step 1: Get Authentication Token
auth_data = await cls.read_and_refresh_token(proxy)
@ -153,6 +159,7 @@ class ARTA(AsyncGeneratorProvider, ProviderModelMixin):
"cfg_scale": str(guidance_scale),
"steps": str(num_inference_steps),
"aspect_ratio": aspect_ratio,
"seed": str(seed),
}
headers = {