webscout 7.5__py3-none-any.whl → 7.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of webscout might be problematic. Click here for more details.
- webscout/AIauto.py +5 -53
- webscout/AIutel.py +8 -318
- webscout/DWEBS.py +460 -489
- webscout/Extra/YTToolkit/YTdownloader.py +14 -53
- webscout/Extra/YTToolkit/transcriber.py +12 -13
- webscout/Extra/YTToolkit/ytapi/video.py +0 -1
- webscout/Extra/__init__.py +0 -1
- webscout/Extra/autocoder/__init__.py +9 -9
- webscout/Extra/autocoder/autocoder_utiles.py +193 -199
- webscout/Extra/autocoder/rawdog.py +789 -677
- webscout/Extra/gguf.py +682 -428
- webscout/Extra/weather.py +178 -156
- webscout/Extra/weather_ascii.py +70 -17
- webscout/Litlogger/core/logger.py +1 -2
- webscout/Litlogger/handlers/file.py +1 -1
- webscout/Litlogger/styles/formats.py +0 -2
- webscout/Litlogger/utils/detectors.py +0 -1
- webscout/Provider/AISEARCH/DeepFind.py +0 -1
- webscout/Provider/AISEARCH/ISou.py +1 -22
- webscout/Provider/AISEARCH/felo_search.py +0 -1
- webscout/Provider/AllenAI.py +28 -30
- webscout/Provider/C4ai.py +29 -11
- webscout/Provider/ChatGPTClone.py +226 -0
- webscout/Provider/ChatGPTGratis.py +24 -56
- webscout/Provider/DeepSeek.py +25 -17
- webscout/Provider/Deepinfra.py +115 -48
- webscout/Provider/Gemini.py +1 -1
- webscout/Provider/Glider.py +33 -12
- webscout/Provider/HF_space/qwen_qwen2.py +2 -2
- webscout/Provider/HeckAI.py +23 -7
- webscout/Provider/Hunyuan.py +272 -0
- webscout/Provider/Jadve.py +20 -5
- webscout/Provider/LambdaChat.py +391 -0
- webscout/Provider/Netwrck.py +42 -19
- webscout/Provider/OLLAMA.py +256 -32
- webscout/Provider/PI.py +4 -2
- webscout/Provider/Perplexitylabs.py +26 -6
- webscout/Provider/PizzaGPT.py +10 -51
- webscout/Provider/TTI/AiForce/async_aiforce.py +4 -37
- webscout/Provider/TTI/AiForce/sync_aiforce.py +41 -38
- webscout/Provider/TTI/FreeAIPlayground/__init__.py +9 -9
- webscout/Provider/TTI/FreeAIPlayground/async_freeaiplayground.py +179 -206
- webscout/Provider/TTI/FreeAIPlayground/sync_freeaiplayground.py +180 -192
- webscout/Provider/TTI/MagicStudio/__init__.py +2 -0
- webscout/Provider/TTI/MagicStudio/async_magicstudio.py +111 -0
- webscout/Provider/TTI/MagicStudio/sync_magicstudio.py +109 -0
- webscout/Provider/TTI/PollinationsAI/async_pollinations.py +5 -24
- webscout/Provider/TTI/PollinationsAI/sync_pollinations.py +2 -22
- webscout/Provider/TTI/__init__.py +2 -3
- webscout/Provider/TTI/aiarta/async_aiarta.py +14 -14
- webscout/Provider/TTI/aiarta/sync_aiarta.py +52 -21
- webscout/Provider/TTI/artbit/async_artbit.py +3 -32
- webscout/Provider/TTI/artbit/sync_artbit.py +3 -31
- webscout/Provider/TTI/fastflux/__init__.py +22 -0
- webscout/Provider/TTI/fastflux/async_fastflux.py +261 -0
- webscout/Provider/TTI/fastflux/sync_fastflux.py +252 -0
- webscout/Provider/TTI/piclumen/__init__.py +22 -22
- webscout/Provider/TTI/piclumen/sync_piclumen.py +232 -232
- webscout/Provider/TTS/__init__.py +2 -2
- webscout/Provider/TTS/deepgram.py +12 -39
- webscout/Provider/TTS/elevenlabs.py +14 -40
- webscout/Provider/TTS/gesserit.py +11 -35
- webscout/Provider/TTS/murfai.py +13 -39
- webscout/Provider/TTS/parler.py +17 -40
- webscout/Provider/TTS/speechma.py +180 -0
- webscout/Provider/TTS/streamElements.py +17 -44
- webscout/Provider/TextPollinationsAI.py +39 -59
- webscout/Provider/Venice.py +25 -8
- webscout/Provider/WebSim.py +227 -0
- webscout/Provider/WiseCat.py +27 -5
- webscout/Provider/Youchat.py +64 -37
- webscout/Provider/__init__.py +12 -7
- webscout/Provider/akashgpt.py +20 -5
- webscout/Provider/flowith.py +33 -7
- webscout/Provider/freeaichat.py +32 -45
- webscout/Provider/koala.py +20 -5
- webscout/Provider/labyrinth.py +239 -0
- webscout/Provider/learnfastai.py +28 -15
- webscout/Provider/llamatutor.py +1 -1
- webscout/Provider/llmchat.py +30 -8
- webscout/Provider/multichat.py +65 -9
- webscout/Provider/sonus.py +208 -0
- webscout/Provider/talkai.py +1 -0
- webscout/Provider/turboseek.py +3 -0
- webscout/Provider/tutorai.py +2 -0
- webscout/Provider/typegpt.py +155 -65
- webscout/Provider/uncovr.py +297 -0
- webscout/Provider/x0gpt.py +3 -1
- webscout/Provider/yep.py +102 -20
- webscout/__init__.py +3 -0
- webscout/cli.py +53 -40
- webscout/conversation.py +1 -10
- webscout/litagent/__init__.py +2 -2
- webscout/litagent/agent.py +356 -20
- webscout/litagent/constants.py +34 -5
- webscout/litprinter/__init__.py +0 -3
- webscout/models.py +181 -0
- webscout/optimizers.py +1 -1
- webscout/prompt_manager.py +2 -8
- webscout/scout/core/scout.py +1 -4
- webscout/scout/core/search_result.py +1 -1
- webscout/scout/core/text_utils.py +1 -1
- webscout/scout/core.py +2 -5
- webscout/scout/element.py +1 -1
- webscout/scout/parsers/html_parser.py +1 -1
- webscout/scout/utils.py +0 -1
- webscout/swiftcli/__init__.py +1 -3
- webscout/tempid.py +1 -1
- webscout/update_checker.py +1 -3
- webscout/version.py +1 -1
- webscout/webscout_search_async.py +1 -2
- webscout/yep_search.py +297 -297
- {webscout-7.5.dist-info → webscout-7.7.dist-info}/LICENSE.md +4 -4
- {webscout-7.5.dist-info → webscout-7.7.dist-info}/METADATA +127 -405
- {webscout-7.5.dist-info → webscout-7.7.dist-info}/RECORD +118 -117
- webscout/Extra/autollama.py +0 -231
- webscout/Provider/Amigo.py +0 -274
- webscout/Provider/Bing.py +0 -243
- webscout/Provider/DiscordRocks.py +0 -253
- webscout/Provider/TTI/blackbox/__init__.py +0 -4
- webscout/Provider/TTI/blackbox/async_blackbox.py +0 -212
- webscout/Provider/TTI/blackbox/sync_blackbox.py +0 -199
- webscout/Provider/TTI/deepinfra/__init__.py +0 -4
- webscout/Provider/TTI/deepinfra/async_deepinfra.py +0 -227
- webscout/Provider/TTI/deepinfra/sync_deepinfra.py +0 -199
- webscout/Provider/TTI/imgninza/__init__.py +0 -4
- webscout/Provider/TTI/imgninza/async_ninza.py +0 -214
- webscout/Provider/TTI/imgninza/sync_ninza.py +0 -209
- webscout/Provider/TTS/voicepod.py +0 -117
- {webscout-7.5.dist-info → webscout-7.7.dist-info}/WHEEL +0 -0
- {webscout-7.5.dist-info → webscout-7.7.dist-info}/entry_points.txt +0 -0
- {webscout-7.5.dist-info → webscout-7.7.dist-info}/top_level.txt +0 -0
|
@@ -25,16 +25,8 @@ from pathlib import Path
|
|
|
25
25
|
from typing import AsyncGenerator
|
|
26
26
|
|
|
27
27
|
from webscout.AIbase import AsyncImageProvider
|
|
28
|
-
from webscout.Litlogger import Logger, LogFormat
|
|
29
28
|
from webscout.litagent import LitAgent
|
|
30
29
|
|
|
31
|
-
# Set up logging with cyberpunk style! 🎨
|
|
32
|
-
logger = Logger(
|
|
33
|
-
name="AsyncPollinationsAI",
|
|
34
|
-
format=LogFormat.MODERN_EMOJI,
|
|
35
|
-
|
|
36
|
-
)
|
|
37
|
-
|
|
38
30
|
# Get a fresh user agent! 🔄
|
|
39
31
|
agent = LitAgent()
|
|
40
32
|
|
|
@@ -91,20 +83,13 @@ class AsyncPollinationsAI(AsyncImageProvider):
|
|
|
91
83
|
- "any-dark": Dark/gothic style
|
|
92
84
|
- "flux-pro": Professional quality
|
|
93
85
|
- "turbo": Fast generation
|
|
94
|
-
|
|
86
|
+
|
|
95
87
|
"""
|
|
96
88
|
|
|
97
89
|
AVAILABLE_MODELS = [
|
|
98
90
|
"flux",
|
|
99
|
-
"flux-realism",
|
|
100
|
-
"flux-cablyai",
|
|
101
|
-
"flux-anime",
|
|
102
|
-
"flux-3d",
|
|
103
|
-
"any-dark",
|
|
104
|
-
"flux-pro",
|
|
105
91
|
"turbo"
|
|
106
92
|
]
|
|
107
|
-
DEFAULT_MODEL = "flux"
|
|
108
93
|
|
|
109
94
|
def __init__(
|
|
110
95
|
self,
|
|
@@ -141,7 +126,7 @@ class AsyncPollinationsAI(AsyncImageProvider):
|
|
|
141
126
|
additives: bool = True,
|
|
142
127
|
width: int = 768,
|
|
143
128
|
height: int = 768,
|
|
144
|
-
model: str =
|
|
129
|
+
model: str = "flux",
|
|
145
130
|
max_retries: int = 3,
|
|
146
131
|
retry_delay: int = 5,
|
|
147
132
|
negative_prompt: Optional[str] = None,
|
|
@@ -214,11 +199,10 @@ class AsyncPollinationsAI(AsyncImageProvider):
|
|
|
214
199
|
params_str = "&".join(f"{k}={v}" for k, v in base_params.items())
|
|
215
200
|
url = f"{self.image_gen_endpoint.format(prompt=current_prompt)}?{params_str}"
|
|
216
201
|
|
|
217
|
-
logger.info(f"Queueing image {_ + 1}/{amount} generation... ⚡")
|
|
218
202
|
tasks.append(self._generate_single(session, url, max_retries, retry_delay))
|
|
219
203
|
|
|
220
204
|
response = await asyncio.gather(*tasks)
|
|
221
|
-
|
|
205
|
+
|
|
222
206
|
|
|
223
207
|
return response
|
|
224
208
|
|
|
@@ -237,9 +221,9 @@ class AsyncPollinationsAI(AsyncImageProvider):
|
|
|
237
221
|
return await resp.read()
|
|
238
222
|
except aiohttp.ClientError as e:
|
|
239
223
|
if attempt == max_retries - 1:
|
|
240
|
-
|
|
224
|
+
|
|
241
225
|
raise
|
|
242
|
-
|
|
226
|
+
|
|
243
227
|
await asyncio.sleep(retry_delay)
|
|
244
228
|
|
|
245
229
|
async def save(
|
|
@@ -277,7 +261,6 @@ class AsyncPollinationsAI(AsyncImageProvider):
|
|
|
277
261
|
save_dir = dir if dir else os.getcwd()
|
|
278
262
|
if not os.path.exists(save_dir):
|
|
279
263
|
os.makedirs(save_dir)
|
|
280
|
-
logger.info(f"Created directory: {save_dir} 📁")
|
|
281
264
|
|
|
282
265
|
saved_paths = []
|
|
283
266
|
timestamp = int(time.time())
|
|
@@ -295,7 +278,6 @@ class AsyncPollinationsAI(AsyncImageProvider):
|
|
|
295
278
|
with open(filepath, "wb") as f:
|
|
296
279
|
f.write(image_bytes)
|
|
297
280
|
|
|
298
|
-
logger.success(f"Saved image to: {filepath} 💾")
|
|
299
281
|
return filepath
|
|
300
282
|
|
|
301
283
|
# Handle both List[bytes] and AsyncGenerator
|
|
@@ -306,7 +288,6 @@ class AsyncPollinationsAI(AsyncImageProvider):
|
|
|
306
288
|
|
|
307
289
|
tasks = [save_single_image(img, i) for i, img in enumerate(image_list)]
|
|
308
290
|
saved_paths = await asyncio.gather(*tasks)
|
|
309
|
-
logger.success(f"Successfully saved all {len(saved_paths)} images! 🎉")
|
|
310
291
|
return saved_paths
|
|
311
292
|
|
|
312
293
|
|
|
@@ -28,15 +28,8 @@ from requests.exceptions import RequestException
|
|
|
28
28
|
from pathlib import Path
|
|
29
29
|
|
|
30
30
|
from webscout.AIbase import ImageProvider
|
|
31
|
-
from webscout.Litlogger import Logger, LogFormat
|
|
32
31
|
from webscout.litagent import LitAgent
|
|
33
32
|
|
|
34
|
-
# Set up logging with cyberpunk style! 🎨
|
|
35
|
-
logger = Logger(
|
|
36
|
-
name="PollinationsAI",
|
|
37
|
-
format=LogFormat.MODERN_EMOJI,
|
|
38
|
-
|
|
39
|
-
)
|
|
40
33
|
|
|
41
34
|
# Get a fresh user agent! 🔄
|
|
42
35
|
agent = LitAgent()
|
|
@@ -83,20 +76,13 @@ class PollinationsAI(ImageProvider):
|
|
|
83
76
|
- "any-dark": Dark/gothic style
|
|
84
77
|
- "flux-pro": Professional quality
|
|
85
78
|
- "turbo": Fast generation
|
|
86
|
-
DEFAULT_MODEL (str): Default model to use ("flux")
|
|
87
79
|
"""
|
|
88
80
|
|
|
89
81
|
AVAILABLE_MODELS = [
|
|
90
82
|
"flux",
|
|
91
|
-
"flux-realism",
|
|
92
|
-
"flux-cablyai",
|
|
93
|
-
"flux-anime",
|
|
94
|
-
"flux-3d",
|
|
95
|
-
"any-dark",
|
|
96
|
-
"flux-pro",
|
|
97
83
|
"turbo"
|
|
98
84
|
]
|
|
99
|
-
|
|
85
|
+
|
|
100
86
|
|
|
101
87
|
def __init__(
|
|
102
88
|
self,
|
|
@@ -136,7 +122,7 @@ class PollinationsAI(ImageProvider):
|
|
|
136
122
|
additives: bool = True,
|
|
137
123
|
width: int = 768,
|
|
138
124
|
height: int = 768,
|
|
139
|
-
model: str =
|
|
125
|
+
model: str = "flux",
|
|
140
126
|
max_retries: int = 3,
|
|
141
127
|
retry_delay: int = 5,
|
|
142
128
|
negative_prompt: Optional[str] = None,
|
|
@@ -197,17 +183,13 @@ class PollinationsAI(ImageProvider):
|
|
|
197
183
|
|
|
198
184
|
for attempt in range(max_retries):
|
|
199
185
|
try:
|
|
200
|
-
logger.info(f"Generating image {_ + 1}/{amount} with prompt: {current_prompt[:50]}...")
|
|
201
186
|
resp = self.session.get(url, timeout=self.timeout)
|
|
202
187
|
resp.raise_for_status()
|
|
203
188
|
response.append(resp.content)
|
|
204
|
-
logger.success(f"Successfully generated image {_ + 1}/{amount}! 🎨")
|
|
205
189
|
break
|
|
206
190
|
except RequestException as e:
|
|
207
191
|
if attempt == max_retries - 1:
|
|
208
|
-
logger.error(f"Failed to generate image after {max_retries} attempts: {e} 😢")
|
|
209
192
|
raise
|
|
210
|
-
logger.warning(f"Attempt {attempt + 1} failed. Retrying in {retry_delay} seconds... 🔄")
|
|
211
193
|
time.sleep(retry_delay)
|
|
212
194
|
|
|
213
195
|
return response
|
|
@@ -246,7 +228,6 @@ class PollinationsAI(ImageProvider):
|
|
|
246
228
|
save_dir = dir if dir else os.getcwd()
|
|
247
229
|
if not os.path.exists(save_dir):
|
|
248
230
|
os.makedirs(save_dir)
|
|
249
|
-
logger.info(f"Created directory: {save_dir} 📁")
|
|
250
231
|
|
|
251
232
|
saved_paths = []
|
|
252
233
|
timestamp = int(time.time())
|
|
@@ -263,7 +244,6 @@ class PollinationsAI(ImageProvider):
|
|
|
263
244
|
f.write(image_bytes)
|
|
264
245
|
|
|
265
246
|
saved_paths.append(filepath)
|
|
266
|
-
logger.success(f"Saved image to: {filepath} 💾")
|
|
267
247
|
|
|
268
248
|
return saved_paths
|
|
269
249
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
from .FreeAIPlayground import *
|
|
2
|
-
from .deepinfra import *
|
|
3
2
|
from .PollinationsAI import *
|
|
4
3
|
from .AiForce import *
|
|
5
|
-
from .blackbox import *
|
|
6
4
|
from .Nexra import *
|
|
7
5
|
from .huggingface import *
|
|
8
6
|
from .artbit import *
|
|
9
|
-
from .imgninza import *
|
|
10
7
|
from .talkai import *
|
|
11
8
|
from .piclumen import *
|
|
9
|
+
from .MagicStudio import *
|
|
10
|
+
from .fastflux import *
|
|
@@ -70,7 +70,7 @@ class AsyncAIArtaImager(AsyncImageProvider):
|
|
|
70
70
|
status_check_url = "https://img-gen-prod.ai-arta.com/api/v1/text2image/{record_id}/status"
|
|
71
71
|
|
|
72
72
|
# Available models
|
|
73
|
-
|
|
73
|
+
AVAILABLE_MODELS = {
|
|
74
74
|
"flux": "Flux",
|
|
75
75
|
"medieval": "Medieval",
|
|
76
76
|
"vincent_van_gogh": "Vincent Van Gogh",
|
|
@@ -109,17 +109,17 @@ class AsyncAIArtaImager(AsyncImageProvider):
|
|
|
109
109
|
"surrealism": "Surrealism",
|
|
110
110
|
"neo_traditional": "Neo-traditional",
|
|
111
111
|
"on_limbs_black": "On limbs black",
|
|
112
|
-
"yamers_realistic_xl": "Yamers-realistic-xl",
|
|
113
|
-
"pony_xl": "Pony-xl",
|
|
114
|
-
"playground_xl": "Playground-xl",
|
|
115
|
-
"anything_xl": "Anything-xl",
|
|
116
|
-
"flame_design": "Flame design",
|
|
117
|
-
"kawaii": "Kawaii",
|
|
118
|
-
"cinematic_art": "Cinematic Art",
|
|
119
|
-
"professional": "Professional",
|
|
120
|
-
"flux_black_ink": "Flux Black Ink"
|
|
112
|
+
# "yamers_realistic_xl": "Yamers-realistic-xl",
|
|
113
|
+
# "pony_xl": "Pony-xl",
|
|
114
|
+
# "playground_xl": "Playground-xl",
|
|
115
|
+
# "anything_xl": "Anything-xl",
|
|
116
|
+
# "flame_design": "Flame design",
|
|
117
|
+
# "kawaii": "Kawaii",
|
|
118
|
+
# "cinematic_art": "Cinematic Art",
|
|
119
|
+
# "professional": "Professional",
|
|
120
|
+
# "flux_black_ink": "Flux Black Ink"
|
|
121
121
|
}
|
|
122
|
-
models = list(
|
|
122
|
+
models = list(AVAILABLE_MODELS.keys())
|
|
123
123
|
|
|
124
124
|
def __init__(self, timeout: int = 60, proxies: dict = None, logging: bool = True):
|
|
125
125
|
"""Initialize your async AIArtaImager provider with custom settings ⚙️
|
|
@@ -226,8 +226,8 @@ class AsyncAIArtaImager(AsyncImageProvider):
|
|
|
226
226
|
|
|
227
227
|
def get_model(self, model_name: str) -> str:
|
|
228
228
|
"""Get actual model name from alias"""
|
|
229
|
-
if model_name.lower() in self.
|
|
230
|
-
return self.
|
|
229
|
+
if model_name.lower() in self.AVAILABLE_MODELS:
|
|
230
|
+
return self.AVAILABLE_MODELS[model_name.lower()]
|
|
231
231
|
return model_name
|
|
232
232
|
|
|
233
233
|
async def generate(
|
|
@@ -261,7 +261,7 @@ class AsyncAIArtaImager(AsyncImageProvider):
|
|
|
261
261
|
Args:
|
|
262
262
|
prompt (str): Your image description
|
|
263
263
|
amount (int): How many images you want (default: 1)
|
|
264
|
-
model (str): Model to use - check
|
|
264
|
+
model (str): Model to use - check AVAILABLE_MODELS (default: "flux")
|
|
265
265
|
negative_prompt (str): What you don't want in the image
|
|
266
266
|
guidance_scale (int): Controls how closely the model follows your prompt
|
|
267
267
|
num_inference_steps (int): More steps = better quality but slower
|
|
@@ -56,7 +56,7 @@ class AIArtaImager(ImageProvider):
|
|
|
56
56
|
status_check_url = "https://img-gen-prod.ai-arta.com/api/v1/text2image/{record_id}/status"
|
|
57
57
|
|
|
58
58
|
# Available models
|
|
59
|
-
|
|
59
|
+
AVAILABLE_MODELS = {
|
|
60
60
|
"flux": "Flux",
|
|
61
61
|
"medieval": "Medieval",
|
|
62
62
|
"vincent_van_gogh": "Vincent Van Gogh",
|
|
@@ -95,17 +95,17 @@ class AIArtaImager(ImageProvider):
|
|
|
95
95
|
"surrealism": "Surrealism",
|
|
96
96
|
"neo_traditional": "Neo-traditional",
|
|
97
97
|
"on_limbs_black": "On limbs black",
|
|
98
|
-
"yamers_realistic_xl": "Yamers-realistic-xl",
|
|
99
|
-
"pony_xl": "Pony-xl",
|
|
100
|
-
"playground_xl": "Playground-xl",
|
|
101
|
-
"anything_xl": "Anything-xl",
|
|
102
|
-
"flame_design": "Flame design",
|
|
103
|
-
"kawaii": "Kawaii",
|
|
104
|
-
"cinematic_art": "Cinematic Art",
|
|
105
|
-
"professional": "Professional",
|
|
106
|
-
"flux_black_ink": "Flux Black Ink"
|
|
98
|
+
# "yamers_realistic_xl": "Yamers-realistic-xl",
|
|
99
|
+
# "pony_xl": "Pony-xl",
|
|
100
|
+
# "playground_xl": "Playground-xl",
|
|
101
|
+
# "anything_xl": "Anything-xl",
|
|
102
|
+
# "flame_design": "Flame design",
|
|
103
|
+
# "kawaii": "Kawaii",
|
|
104
|
+
# "cinematic_art": "Cinematic Art",
|
|
105
|
+
# "professional": "Professional",
|
|
106
|
+
# "flux_black_ink": "Flux Black Ink"
|
|
107
107
|
}
|
|
108
|
-
models = list(
|
|
108
|
+
models = list(AVAILABLE_MODELS.keys())
|
|
109
109
|
|
|
110
110
|
def __init__(self, timeout: int = 60, proxies: dict = None, logging: bool = True):
|
|
111
111
|
"""Initialize your AIArtaImager provider with custom settings
|
|
@@ -196,8 +196,8 @@ class AIArtaImager(ImageProvider):
|
|
|
196
196
|
|
|
197
197
|
def get_model(self, model_name: str) -> str:
|
|
198
198
|
"""Get actual model name from alias"""
|
|
199
|
-
if model_name.lower() in self.
|
|
200
|
-
return self.
|
|
199
|
+
if model_name.lower() in self.AVAILABLE_MODELS:
|
|
200
|
+
return self.AVAILABLE_MODELS[model_name.lower()]
|
|
201
201
|
return model_name
|
|
202
202
|
|
|
203
203
|
def generate(
|
|
@@ -230,7 +230,7 @@ class AIArtaImager(ImageProvider):
|
|
|
230
230
|
Args:
|
|
231
231
|
prompt (str): Your image description
|
|
232
232
|
amount (int): How many images you want (default: 1)
|
|
233
|
-
model (str): Model to use - check
|
|
233
|
+
model (str): Model to use - check AVAILABLE_MODELS (default: "flux")
|
|
234
234
|
negative_prompt (str): What you don't want in the image
|
|
235
235
|
guidance_scale (int): Controls how closely the model follows your prompt
|
|
236
236
|
num_inference_steps (int): More steps = better quality but slower
|
|
@@ -400,10 +400,41 @@ class AIArtaImager(ImageProvider):
|
|
|
400
400
|
|
|
401
401
|
if __name__ == "__main__":
|
|
402
402
|
# Example usage
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
403
|
+
bot = AIArtaImager()
|
|
404
|
+
test_prompt = "A shiny red sports car speeding down a scenic mountain road"
|
|
405
|
+
|
|
406
|
+
print(f"Testing all available models with prompt: '{test_prompt}'")
|
|
407
|
+
print("-" * 50)
|
|
408
|
+
|
|
409
|
+
# Create a directory for test images if it doesn't exist
|
|
410
|
+
test_dir = "model_test_images"
|
|
411
|
+
if not os.path.exists(test_dir):
|
|
412
|
+
os.makedirs(test_dir)
|
|
413
|
+
|
|
414
|
+
for model in bot.AVAILABLE_MODELS:
|
|
415
|
+
print(f"Testing model: {model}")
|
|
416
|
+
try:
|
|
417
|
+
# Generate an image with the current model
|
|
418
|
+
resp = bot.generate(
|
|
419
|
+
prompt=test_prompt,
|
|
420
|
+
amount=1,
|
|
421
|
+
model=model,
|
|
422
|
+
width=768,
|
|
423
|
+
height=768
|
|
424
|
+
)
|
|
425
|
+
|
|
426
|
+
# Save the image with model name as prefix
|
|
427
|
+
saved_paths = bot.save(
|
|
428
|
+
resp,
|
|
429
|
+
name=f"{model}_test",
|
|
430
|
+
dir=test_dir,
|
|
431
|
+
filenames_prefix=f"{model}_"
|
|
432
|
+
)
|
|
433
|
+
|
|
434
|
+
print(f"✓ Success! Saved image: {saved_paths[0]}")
|
|
435
|
+
except Exception as e:
|
|
436
|
+
print(f"✗ Failed with model {model}: {str(e)}")
|
|
437
|
+
|
|
438
|
+
print("-" * 30)
|
|
439
|
+
|
|
440
|
+
print("All model tests completed!")
|
|
@@ -6,8 +6,8 @@ Examples:
|
|
|
6
6
|
>>> import asyncio
|
|
7
7
|
>>>
|
|
8
8
|
>>> async def example():
|
|
9
|
-
... # Initialize
|
|
10
|
-
... provider = AsyncArtbitImager(
|
|
9
|
+
... # Initialize provider
|
|
10
|
+
... provider = AsyncArtbitImager()
|
|
11
11
|
...
|
|
12
12
|
... # Generate a single image
|
|
13
13
|
... images = await provider.generate("Cool art")
|
|
@@ -33,27 +33,19 @@ import asyncio
|
|
|
33
33
|
import os
|
|
34
34
|
from typing import List
|
|
35
35
|
from webscout.AIbase import AsyncImageProvider
|
|
36
|
-
from webscout.Litlogger import Logger, LogFormat
|
|
37
36
|
from webscout.litagent import LitAgent
|
|
38
37
|
|
|
39
|
-
# Initialize our fire logger and agent 🔥
|
|
40
|
-
logger = Logger(
|
|
41
|
-
"AsyncArtbit",
|
|
42
|
-
format=LogFormat.MODERN_EMOJI,
|
|
43
|
-
|
|
44
|
-
)
|
|
45
38
|
agent = LitAgent()
|
|
46
39
|
|
|
47
40
|
class AsyncArtbitImager(AsyncImageProvider):
|
|
48
41
|
"""Your go-to async provider for generating fire images with Artbit! ⚡"""
|
|
49
42
|
|
|
50
|
-
def __init__(self, timeout: int = 60, proxies: dict = {}
|
|
43
|
+
def __init__(self, timeout: int = 60, proxies: dict = {}):
|
|
51
44
|
"""Initialize your async Artbit provider with custom settings! ⚙️
|
|
52
45
|
|
|
53
46
|
Args:
|
|
54
47
|
timeout (int): Request timeout in seconds (default: 60)
|
|
55
48
|
proxies (dict): Proxy settings for requests (default: {})
|
|
56
|
-
logging (bool): Enable fire logging (default: True)
|
|
57
49
|
"""
|
|
58
50
|
self.url = "https://artbit.ai/api/generateImage"
|
|
59
51
|
self.headers = {
|
|
@@ -65,9 +57,6 @@ class AsyncArtbitImager(AsyncImageProvider):
|
|
|
65
57
|
self.proxies = proxies
|
|
66
58
|
self.prompt: str = "AI-generated image - webscout"
|
|
67
59
|
self.image_extension: str = "png"
|
|
68
|
-
self.logging = logging
|
|
69
|
-
if self.logging:
|
|
70
|
-
logger.info("AsyncArtbit provider initialized! 🚀")
|
|
71
60
|
|
|
72
61
|
async def generate(
|
|
73
62
|
self,
|
|
@@ -96,9 +85,6 @@ class AsyncArtbitImager(AsyncImageProvider):
|
|
|
96
85
|
self.prompt = prompt
|
|
97
86
|
response: List[str] = []
|
|
98
87
|
|
|
99
|
-
if self.logging:
|
|
100
|
-
logger.info(f"Generating {amount} images with {caption_model}... 🎨")
|
|
101
|
-
|
|
102
88
|
payload = {
|
|
103
89
|
"captionInput": prompt,
|
|
104
90
|
"captionModel": caption_model,
|
|
@@ -113,18 +99,10 @@ class AsyncArtbitImager(AsyncImageProvider):
|
|
|
113
99
|
resp.raise_for_status()
|
|
114
100
|
response_data = await resp.json()
|
|
115
101
|
imgs = response_data.get("imgs", [])
|
|
116
|
-
|
|
117
102
|
if imgs:
|
|
118
103
|
response.extend(imgs)
|
|
119
|
-
if self.logging:
|
|
120
|
-
logger.success("Images generated successfully! 🎉")
|
|
121
|
-
else:
|
|
122
|
-
if self.logging:
|
|
123
|
-
logger.warning("No images found in the response 😢")
|
|
124
104
|
|
|
125
105
|
except aiohttp.ClientError as e:
|
|
126
|
-
if self.logging:
|
|
127
|
-
logger.error(f"Failed to generate images: {e} 😢")
|
|
128
106
|
raise
|
|
129
107
|
|
|
130
108
|
return response
|
|
@@ -153,9 +131,6 @@ class AsyncArtbitImager(AsyncImageProvider):
|
|
|
153
131
|
filenames = []
|
|
154
132
|
count = 0
|
|
155
133
|
|
|
156
|
-
if self.logging:
|
|
157
|
-
logger.info(f"Saving {len(response)} images... 💾")
|
|
158
|
-
|
|
159
134
|
async with aiohttp.ClientSession(headers=self.headers) as session:
|
|
160
135
|
for img_url in response:
|
|
161
136
|
def complete_path():
|
|
@@ -175,10 +150,6 @@ class AsyncArtbitImager(AsyncImageProvider):
|
|
|
175
150
|
await fh.write(await resp.read())
|
|
176
151
|
|
|
177
152
|
except aiohttp.ClientError as e:
|
|
178
|
-
if self.logging:
|
|
179
|
-
logger.error(f"Failed to save image from {img_url}: {e} 😢")
|
|
180
153
|
raise
|
|
181
154
|
|
|
182
|
-
if self.logging:
|
|
183
|
-
logger.success(f"Images saved successfully! Check {dir} 🎉")
|
|
184
155
|
return filenames
|
|
@@ -4,8 +4,8 @@ ArtbitImager - Your go-to provider for generating fire images with Artbit! 🔥
|
|
|
4
4
|
Examples:
|
|
5
5
|
>>> from webscout import ArtbitImager
|
|
6
6
|
>>>
|
|
7
|
-
>>> # Initialize
|
|
8
|
-
>>> provider = ArtbitImager(
|
|
7
|
+
>>> # Initialize provider
|
|
8
|
+
>>> provider = ArtbitImager()
|
|
9
9
|
>>>
|
|
10
10
|
>>> # Generate a single image
|
|
11
11
|
>>> images = provider.generate("Cool art")
|
|
@@ -27,27 +27,19 @@ import os
|
|
|
27
27
|
import requests
|
|
28
28
|
from typing import List
|
|
29
29
|
from webscout.AIbase import ImageProvider
|
|
30
|
-
from webscout.Litlogger import Logger, LogFormat
|
|
31
30
|
from webscout.litagent import LitAgent
|
|
32
31
|
|
|
33
|
-
# Initialize our fire logger and agent 🔥
|
|
34
|
-
logger = Logger(
|
|
35
|
-
"Artbit",
|
|
36
|
-
format=LogFormat.MODERN_EMOJI,
|
|
37
|
-
|
|
38
|
-
)
|
|
39
32
|
agent = LitAgent()
|
|
40
33
|
|
|
41
34
|
class ArtbitImager(ImageProvider):
|
|
42
35
|
"""Your go-to provider for generating fire images with Artbit! 🔥"""
|
|
43
36
|
|
|
44
|
-
def __init__(self, timeout: int = 60, proxies: dict = {}
|
|
37
|
+
def __init__(self, timeout: int = 60, proxies: dict = {}):
|
|
45
38
|
"""Initialize your Artbit provider with custom settings! ⚙️
|
|
46
39
|
|
|
47
40
|
Args:
|
|
48
41
|
timeout (int): Request timeout in seconds (default: 60)
|
|
49
42
|
proxies (dict): Proxy settings for requests (default: {})
|
|
50
|
-
logging (bool): Enable fire logging (default: True)
|
|
51
43
|
"""
|
|
52
44
|
self.url = "https://artbit.ai/api/generateImage"
|
|
53
45
|
self.scraper = cloudscraper.create_scraper()
|
|
@@ -56,9 +48,6 @@ class ArtbitImager(ImageProvider):
|
|
|
56
48
|
self.timeout = timeout
|
|
57
49
|
self.prompt: str = "AI-generated image - webscout"
|
|
58
50
|
self.image_extension: str = "png"
|
|
59
|
-
self.logging = logging
|
|
60
|
-
if self.logging:
|
|
61
|
-
logger.info("Artbit provider initialized! 🚀")
|
|
62
51
|
|
|
63
52
|
def generate(
|
|
64
53
|
self,
|
|
@@ -87,9 +76,6 @@ class ArtbitImager(ImageProvider):
|
|
|
87
76
|
self.prompt = prompt
|
|
88
77
|
response: List[str] = []
|
|
89
78
|
|
|
90
|
-
if self.logging:
|
|
91
|
-
logger.info(f"Generating {amount} images with {caption_model}... 🎨")
|
|
92
|
-
|
|
93
79
|
payload = {
|
|
94
80
|
"captionInput": prompt,
|
|
95
81
|
"captionModel": caption_model,
|
|
@@ -107,15 +93,8 @@ class ArtbitImager(ImageProvider):
|
|
|
107
93
|
|
|
108
94
|
if imgs:
|
|
109
95
|
response.extend(imgs)
|
|
110
|
-
if self.logging:
|
|
111
|
-
logger.success("Images generated successfully! 🎉")
|
|
112
|
-
else:
|
|
113
|
-
if self.logging:
|
|
114
|
-
logger.warning("No images found in the response 😢")
|
|
115
96
|
|
|
116
97
|
except requests.RequestException as e:
|
|
117
|
-
if self.logging:
|
|
118
|
-
logger.error(f"Failed to generate images: {e} 😢")
|
|
119
98
|
raise
|
|
120
99
|
|
|
121
100
|
return response
|
|
@@ -144,9 +123,6 @@ class ArtbitImager(ImageProvider):
|
|
|
144
123
|
filenames = []
|
|
145
124
|
count = 0
|
|
146
125
|
|
|
147
|
-
if self.logging:
|
|
148
|
-
logger.info(f"Saving {len(response)} images... 💾")
|
|
149
|
-
|
|
150
126
|
for img_url in response:
|
|
151
127
|
def complete_path():
|
|
152
128
|
count_value = "" if count == 0 else f"_{count}"
|
|
@@ -167,10 +143,6 @@ class ArtbitImager(ImageProvider):
|
|
|
167
143
|
fh.write(chunk)
|
|
168
144
|
|
|
169
145
|
except requests.exceptions.RequestException as e:
|
|
170
|
-
if self.logging:
|
|
171
|
-
logger.error(f"Failed to save image from {img_url}: {e} 😢")
|
|
172
146
|
raise
|
|
173
147
|
|
|
174
|
-
if self.logging:
|
|
175
|
-
logger.success(f"Images saved successfully! Check {dir} 🎉")
|
|
176
148
|
return filenames
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""
|
|
2
|
+
FastFlux Image Generator - Your go-to provider for generating fire images! 🔥
|
|
3
|
+
|
|
4
|
+
Examples:
|
|
5
|
+
>>> # Sync Usage
|
|
6
|
+
>>> from webscout import FastFluxImager
|
|
7
|
+
>>> provider = FastFluxImager()
|
|
8
|
+
>>> images = provider.generate("Cool art")
|
|
9
|
+
>>> paths = provider.save(images)
|
|
10
|
+
>>>
|
|
11
|
+
>>> # Async Usage
|
|
12
|
+
>>> from webscout import AsyncFastFluxImager
|
|
13
|
+
>>> async def example():
|
|
14
|
+
... provider = AsyncFastFluxImager()
|
|
15
|
+
... images = await provider.generate("Epic dragon")
|
|
16
|
+
... paths = await provider.save(images)
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
from .sync_fastflux import FastFluxImager
|
|
20
|
+
from .async_fastflux import AsyncFastFluxImager
|
|
21
|
+
|
|
22
|
+
__all__ = ["FastFluxImager", "AsyncFastFluxImager"]
|