mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
Merge pull request #2792 from nazdridoy/ARTA-fix-and-add-seed
fix: ARTA model and add optional seed parameter
This commit is contained in:
commit
2795861341
1 changed files with 8 additions and 1 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue