XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

fix: ARTA model and add optional seed parameter

- [fix] change model alias from "flux_black_ink" to "black_ink" in g4f/Provider/ARTA.py - [feat] Add optional seed parameter with random generation in ARTA.

5e1e825c
nazDridoy <nazDridoy399@gmail.com>
提交于

代码差异

1 个文件 +8 -1
Modified g4f/Provider/ARTA.py +8 -1
@@ -3,6 +3,7 @@ from __future__ import annotations
3 3 import os
4 4 import time
5 5 import json
6 import random
6 7 from pathlib import Path
7 8 from aiohttp import ClientSession
8 9 import asyncio
@@ -72,7 +73,7 @@ class ARTA(AsyncGeneratorProvider, ProviderModelMixin):
72 73 "kawaii": "Kawaii",
73 74 "cinematic_art": "Cinematic Art",
74 75 "professional": "Professional",
75 "flux_black_ink": "Flux Black Ink"
76 "black_ink": "Black Ink"
76 77 }
77 78 image_models = [*model_aliases.keys()]
78 79 models = image_models
@@ -135,11 +136,16 @@ class ARTA(AsyncGeneratorProvider, ProviderModelMixin):
135 136 guidance_scale: int = 7,
136 137 num_inference_steps: int = 30,
137 138 aspect_ratio: str = "1:1",
139 seed: int = None,
138 140 **kwargs
139 141 ) -> AsyncResult:
140 142 model = cls.get_model(model)
141 143 prompt = format_image_prompt(messages, prompt)
142 144
145 # Generate a random seed if not provided
146 if seed is None:
147 seed = random.randint(9999, 99999999) # Common range for random seeds
148
143 149 # Step 1: Get Authentication Token
144 150 auth_data = await cls.read_and_refresh_token(proxy)
145 151
@@ -153,6 +159,7 @@ class ARTA(AsyncGeneratorProvider, ProviderModelMixin):
153 159 "cfg_scale": str(guidance_scale),
154 160 "steps": str(num_inference_steps),
155 161 "aspect_ratio": aspect_ratio,
162 "seed": str(seed),
156 163 }
157 164
158 165 headers = {