MeUtils 2025.5.9.17.18.7__py3-none-any.whl → 2025.5.12.15.21.44__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.
- {MeUtils-2025.5.9.17.18.7.dist-info → MeUtils-2025.5.12.15.21.44.dist-info}/METADATA +258 -258
- {MeUtils-2025.5.9.17.18.7.dist-info → MeUtils-2025.5.12.15.21.44.dist-info}/RECORD +12 -12
- meutils/apis/google/chat.py +17 -25
- meutils/apis/hailuoai/images.py +2 -29
- meutils/apis/hailuoai/videos.py +3 -4
- meutils/apis/jimeng/images.py +270 -8
- meutils/data/VERSION +1 -1
- meutils/llm/completions/todo.py +15 -0
- meutils/apis/google//350/247/206/351/242/221/350/247/243/346/236/220V1.2.4-/346/211/223/346/211/271/345/217/2212/346/254/241+/346/257/224/350/276/2034.11.py +0 -332
- {MeUtils-2025.5.9.17.18.7.dist-info → MeUtils-2025.5.12.15.21.44.dist-info}/LICENSE +0 -0
- {MeUtils-2025.5.9.17.18.7.dist-info → MeUtils-2025.5.12.15.21.44.dist-info}/WHEEL +0 -0
- {MeUtils-2025.5.9.17.18.7.dist-info → MeUtils-2025.5.12.15.21.44.dist-info}/entry_points.txt +0 -0
- {MeUtils-2025.5.9.17.18.7.dist-info → MeUtils-2025.5.12.15.21.44.dist-info}/top_level.txt +0 -0
meutils/apis/google/chat.py
CHANGED
@@ -109,8 +109,7 @@ class Completions(object):
|
|
109
109
|
# https://ai.google.dev/gemini-api/docs/document-processing?hl=zh-cn&lang=python
|
110
110
|
file_objects = await self.upload(urls)
|
111
111
|
for file_object in file_objects:
|
112
|
-
|
113
|
-
yield i
|
112
|
+
self.check_file(file_object)
|
114
113
|
|
115
114
|
contents += file_objects
|
116
115
|
contents.append(request.last_user_content)
|
@@ -122,28 +121,26 @@ class Completions(object):
|
|
122
121
|
file_object = await self.upload(url)
|
123
122
|
yield f"```json\n{file_object.model_dump_json(indent=4)}\n```\n\n"
|
124
123
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
#
|
141
|
-
# await asyncio.sleep(3)
|
124
|
+
s = time.time()
|
125
|
+
for i in range(100):
|
126
|
+
file_object = self.client.files.get(
|
127
|
+
name=file_object.name,
|
128
|
+
config={"http_options": {"timeout": 300 * 1000}}
|
129
|
+
)
|
130
|
+
|
131
|
+
logger.debug(file_object)
|
132
|
+
if file_object.state.name in {"ACTIVE", }:
|
133
|
+
yield f"100%) ✅️✅️✅️{time.time() - s:.2f}s.\n\n"
|
134
|
+
break
|
135
|
+
else:
|
136
|
+
yield f"{min(i * 5, 99)}%"
|
137
|
+
|
138
|
+
await asyncio.sleep(3)
|
142
139
|
|
143
140
|
# {'error': {'code': 400,
|
144
141
|
# 'message': 'The File cwjpskscrjd79hjezu7dhb is not in an ACTIVE state and usage is not allowed.',
|
145
142
|
# 'status': 'FAILED_PRECONDITION'}}
|
146
|
-
|
143
|
+
#
|
147
144
|
# while file_object.state.name == "ACTIVE":
|
148
145
|
# logger.debug(file_object)
|
149
146
|
# await asyncio.sleep(1)
|
@@ -373,9 +370,7 @@ class Completions(object):
|
|
373
370
|
)
|
374
371
|
|
375
372
|
def check_file(self, file_object):
|
376
|
-
s = time.time()
|
377
373
|
|
378
|
-
yield f"> [🤔Thinking]("
|
379
374
|
for i in range(100):
|
380
375
|
file_object = self.client.files.get(
|
381
376
|
name=file_object.name,
|
@@ -384,10 +379,7 @@ class Completions(object):
|
|
384
379
|
|
385
380
|
logger.debug(file_object)
|
386
381
|
if file_object.state.name in {"ACTIVE", }: # FAILED_PRECONDITION
|
387
|
-
yield f"100%) ✅️✅️✅️{time.time() - s:.2f}s.\n\n"
|
388
382
|
break
|
389
|
-
else:
|
390
|
-
yield f"{min(i * 5, 99)}%"
|
391
383
|
|
392
384
|
time.sleep(3)
|
393
385
|
|
meutils/apis/hailuoai/images.py
CHANGED
@@ -211,10 +211,10 @@ async def get_request_policy(token):
|
|
211
211
|
|
212
212
|
@retrying(predicate=lambda r: r.base_resp.status_code in {1000061, 1500009}) # 限流
|
213
213
|
async def create_task(request: ImageRequest, token: Optional[str] = None):
|
214
|
-
|
215
214
|
refresh_token = token or await get_next_token_for_polling(FEISHU_URL, from_redis=True, check_token=check_token)
|
216
215
|
BASE_URL = get_base_url(refresh_token)
|
217
216
|
|
217
|
+
token = refresh_token
|
218
218
|
# token = await get_access_token(refresh_token) ##########
|
219
219
|
|
220
220
|
payload = {
|
@@ -290,35 +290,8 @@ async def create_task(request: ImageRequest, token: Optional[str] = None):
|
|
290
290
|
detail=response.base_resp)
|
291
291
|
|
292
292
|
return response
|
293
|
-
# {
|
294
|
-
# "statusInfo": {
|
295
|
-
# "code": 1000061,
|
296
|
-
# "httpCode": 0,
|
297
|
-
# "message": "上一个视频任务未完成,请稍后再试",
|
298
|
-
# "serviceTime": 1729512914,
|
299
|
-
# "requestID": "82bc8c60-4dc3-4ad0-b5b6-b1836e0c88ab",
|
300
|
-
# "debugInfo": "",
|
301
|
-
# "serverAlert": 0
|
302
|
-
# }
|
303
|
-
# }
|
304
|
-
|
305
|
-
# {
|
306
|
-
# "data": {
|
307
|
-
# "id": "304746220940677121"
|
308
|
-
# },
|
309
|
-
# "statusInfo": {
|
310
|
-
# "code": 0,
|
311
|
-
# "httpCode": 0,
|
312
|
-
# "message": "成功",
|
313
|
-
# "serviceTime": 1729513305,
|
314
|
-
# "requestID": "caaf2364-d2ed-45df-b79a-827810a5d58c",
|
315
|
-
# "debugInfo": "",
|
316
|
-
# "serverAlert": 0
|
317
|
-
# }
|
318
|
-
# }
|
319
293
|
|
320
294
|
|
321
|
-
# 307134660730421250
|
322
295
|
async def get_task(task_id: str, token: str):
|
323
296
|
BASE_URL = get_base_url(token)
|
324
297
|
|
@@ -437,7 +410,7 @@ if __name__ == '__main__': # 304752356930580482
|
|
437
410
|
|
438
411
|
token = None
|
439
412
|
# token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDQ3MDMwNzIsInVzZXIiOnsiaWQiOiIzMDI4MzM4Njc3NzE5NDkwNTgiLCJuYW1lIjoibWUgYmV0dGVyIiwiYXZhdGFyIjoiIiwiZGV2aWNlSUQiOiIzMDI4MzM3NTk1MTI3NjQ0MTciLCJpc0Fub255bW91cyI6ZmFsc2V9fQ.Mjb64ZjkKyV9pj-_bXyLczU6kU729VLaKbYj9NmrK-4"
|
440
|
-
token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDg3Mzg4MTQsInVzZXIiOnsiaWQiOiIyMjkwODQ3NTA2MDEzODgwMzciLCJuYW1lIjoi5bCP6J665bi9ODAzNyIsImF2YXRhciI6Imh0dHBzOi8vY2RuLmhhaWx1b2FpLmNvbS9wcm9kL3VzZXJfYXZhdGFyLzE3MDYyNjc3MTEyODI3NzA4NzItMTczMTk0NTcwNjY4OTY1ODk2b3ZlcnNpemUucG5nIiwiZGV2aWNlSUQiOiIyNDM3MTMyNTI1NDU5ODY1NjIiLCJpc0Fub255bW91cyI6ZmFsc2V9fQ.o0SoZMSTWkXNHxJjt3Ggby5MJWSfd-rnK_I95T_WMP8"
|
413
|
+
# token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDg3Mzg4MTQsInVzZXIiOnsiaWQiOiIyMjkwODQ3NTA2MDEzODgwMzciLCJuYW1lIjoi5bCP6J665bi9ODAzNyIsImF2YXRhciI6Imh0dHBzOi8vY2RuLmhhaWx1b2FpLmNvbS9wcm9kL3VzZXJfYXZhdGFyLzE3MDYyNjc3MTEyODI3NzA4NzItMTczMTk0NTcwNjY4OTY1ODk2b3ZlcnNpemUucG5nIiwiZGV2aWNlSUQiOiIyNDM3MTMyNTI1NDU5ODY1NjIiLCJpc0Fub255bW91cyI6ZmFsc2V9fQ.o0SoZMSTWkXNHxJjt3Ggby5MJWSfd-rnK_I95T_WMP8"
|
441
414
|
request = ImageRequest(
|
442
415
|
model="hailuo-image-01",
|
443
416
|
|
meutils/apis/hailuoai/videos.py
CHANGED
@@ -208,8 +208,6 @@ async def get_request_policy(token):
|
|
208
208
|
|
209
209
|
@retrying(predicate=lambda r: r.base_resp.status_code in {1000061, 1500009}) # 限流
|
210
210
|
async def create_task(request: VideoRequest, token: Optional[str] = None):
|
211
|
-
|
212
|
-
|
213
211
|
refresh_token = token or await get_next_token_for_polling(FEISHU_URL, from_redis=True, check_token=check_token)
|
214
212
|
# refresh_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDA0NzA4NzgsInVzZXIiOnsiaWQiOiIzMjg2MDg4ODkzNTA4MTU3NDQiLCJuYW1lIjoiUm9idXN0IEdlcnRydWRlIiwiYXZhdGFyIjoiaHR0cHM6Ly9jZG4uaGFpbHVvYWkudmlkZW8vbW9zcy9wcm9kLzIwMjQtMTItMjgtMTYvdXNlci91c2VyX2F2YXRhci8xNzM1Mzc1OTI0OTkyMTcxMDY3LWF2YXRhcl8zMjg2MDg4ODkzNTA4MTU3NDQiLCJkZXZpY2VJRCI6IjMwMjgzMzc1OTUxMjc2NDQxNyIsImlzQW5vbnltb3VzIjpmYWxzZX19.dLNBSHjqnKutGl3ralS2g8A-RodHjOdos11vdpbkPwc"
|
215
213
|
|
@@ -272,7 +270,8 @@ async def create_task(request: VideoRequest, token: Optional[str] = None):
|
|
272
270
|
params = {
|
273
271
|
'device_platform': 'web',
|
274
272
|
'app_id': '3001',
|
275
|
-
'version_code': '
|
273
|
+
'version_code': '22202',
|
274
|
+
'biz_id': 0,
|
276
275
|
'uuid': '8c059369-00bf-4777-a426-d9c9b7984ee6',
|
277
276
|
'device_id': '243713252545986562',
|
278
277
|
'os_name': 'Mac',
|
@@ -450,7 +449,7 @@ if __name__ == '__main__': # 304752356930580482
|
|
450
449
|
token = None
|
451
450
|
# token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDQ3MDMwNzIsInVzZXIiOnsiaWQiOiIzMDI4MzM4Njc3NzE5NDkwNTgiLCJuYW1lIjoibWUgYmV0dGVyIiwiYXZhdGFyIjoiIiwiZGV2aWNlSUQiOiIzMDI4MzM3NTk1MTI3NjQ0MTciLCJpc0Fub255bW91cyI6ZmFsc2V9fQ.Mjb64ZjkKyV9pj-_bXyLczU6kU729VLaKbYj9NmrK-4"
|
452
451
|
# token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDg3Mzg4MTQsInVzZXIiOnsiaWQiOiIyMjkwODQ3NTA2MDEzODgwMzciLCJuYW1lIjoi5bCP6J665bi9ODAzNyIsImF2YXRhciI6Imh0dHBzOi8vY2RuLmhhaWx1b2FpLmNvbS9wcm9kL3VzZXJfYXZhdGFyLzE3MDYyNjc3MTEyODI3NzA4NzItMTczMTk0NTcwNjY4OTY1ODk2b3ZlcnNpemUucG5nIiwiZGV2aWNlSUQiOiIyNDM3MTMyNTI1NDU5ODY1NjIiLCJpc0Fub255bW91cyI6ZmFsc2V9fQ.o0SoZMSTWkXNHxJjt3Ggby5MJWSfd-rnK_I95T_WMP8"
|
453
|
-
|
452
|
+
token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NTAxMjg4NTIsInVzZXIiOnsiaWQiOiIzNzQwMTM3NzUyNzg4ODY5MTciLCJuYW1lIjoiTmFodWVsIE1vbGluYSIsImF2YXRhciI6IiIsImRldmljZUlEIjoiMzEzMzc0MTIyMjEyMjc4MjczIiwiaXNBbm9ueW1vdXMiOmZhbHNlfX0.uxTtDTcPT07piVA-x3N2ms2VrRN3JwcU99g_HJLwqLE"
|
454
453
|
request = VideoRequest(
|
455
454
|
model="t2v-01",
|
456
455
|
# model="S2V-01-live",
|
meutils/apis/jimeng/images.py
CHANGED
@@ -9,6 +9,7 @@
|
|
9
9
|
# @Description :
|
10
10
|
"""
|
11
11
|
guidance 控制精细度 => sample_strength 0-1 数值越大生成的效果质量越好,耗时会更久
|
12
|
+
paths: ["/mweb/v1/generate", "/mweb/v1/super_resolution", "/mweb/v1/painting", "/commerce/v1/subscription/make_unauto_order", "/commerce/v1/benefits/credit_receive", "/commerce/v1/purchase/make_order", "/mweb/v1/get_explore", "/mweb/v1/feed_short_video", "/mweb/v1/feed", "/mweb/v1/get_homepage", "/mweb/v1/get_weekly_challenge_work_list", "/mweb/v1/mget_item_info", "/mweb/v1/get_item_info", "/mweb/v1/get_history_by_ids", "/mweb/search/v1/search"],
|
12
13
|
|
13
14
|
"""
|
14
15
|
import json
|
@@ -206,7 +207,7 @@ def key_builder(*args, **kwargs):
|
|
206
207
|
|
207
208
|
|
208
209
|
@retrying()
|
209
|
-
@rcache(ttl=
|
210
|
+
@rcache(ttl=1 * 1 * 3600, serializer="pickle", key_builder=lambda *args, **kwargs: f"{args[1].seed} {args[1].prompt}")
|
210
211
|
async def create_task(request: ImageRequest, token: Optional[str] = None): # todo: 图片
|
211
212
|
token = token or await get_next_token_for_polling(FEISHU_URL, check_token)
|
212
213
|
|
@@ -281,7 +282,6 @@ async def create_task(request: ImageRequest, token: Optional[str] = None): # to
|
|
281
282
|
@retrying(max_retries=3, min=3)
|
282
283
|
async def get_task(task_id, token):
|
283
284
|
url = "/mweb/v1/get_history_by_ids"
|
284
|
-
|
285
285
|
headers = get_headers(url, token)
|
286
286
|
|
287
287
|
payload = {
|
@@ -294,14 +294,25 @@ async def get_task(task_id, token):
|
|
294
294
|
response = await client.post(url, json=payload)
|
295
295
|
response.raise_for_status()
|
296
296
|
|
297
|
+
logger.debug(response.text)
|
298
|
+
|
299
|
+
task_info = {}
|
297
300
|
if response.text:
|
298
301
|
data = response.json()
|
302
|
+
logger.debug(bjson(data))
|
303
|
+
task_info = (data.get("data") or {}).get(task_id, {})
|
299
304
|
else:
|
300
|
-
|
305
|
+
logger.debug("走 /mweb/v1/get_history")
|
306
|
+
|
307
|
+
data = await get_task_plus(task_id, token)
|
308
|
+
|
309
|
+
records_list = (data.get("data") or {}).get("records_list", [])
|
310
|
+
|
311
|
+
for record in records_list:
|
312
|
+
if record.get("history_record_id") == task_id:
|
313
|
+
task_info = record
|
301
314
|
|
302
|
-
logger.debug(bjson(data))
|
303
315
|
# {'ret': '1015', 'errmsg': 'login error', 'systime': '1734524280', 'logid': '20241218201800AC3267447B287E9E6C46', 'data': None}
|
304
|
-
task_info = (data.get("data") or {}).get(task_id, {})
|
305
316
|
item_list = task_info.get("item_list", []) # "status": 30,
|
306
317
|
|
307
318
|
status_code = task_info.get("status")
|
@@ -337,6 +348,254 @@ async def get_task(task_id, token):
|
|
337
348
|
return response
|
338
349
|
|
339
350
|
|
351
|
+
@retrying(max_retries=3, min=3)
|
352
|
+
async def get_task_plus(task_id, token):
|
353
|
+
url = "/mweb/v1/get_history"
|
354
|
+
headers = get_headers(url, token)
|
355
|
+
|
356
|
+
params = {
|
357
|
+
"aid": 513695,
|
358
|
+
"da_version": "3.2.2",
|
359
|
+
"aigc_features": "app_lip_sync",
|
360
|
+
}
|
361
|
+
|
362
|
+
payload = {
|
363
|
+
"count": 20,
|
364
|
+
"history_type_list": [
|
365
|
+
1,
|
366
|
+
4,
|
367
|
+
5,
|
368
|
+
6,
|
369
|
+
7,
|
370
|
+
8
|
371
|
+
],
|
372
|
+
"direction": 1,
|
373
|
+
"mode": "workbench",
|
374
|
+
"image_info": {
|
375
|
+
"width": 2048,
|
376
|
+
"height": 2048,
|
377
|
+
"format": "webp",
|
378
|
+
"image_scene_list": [
|
379
|
+
{
|
380
|
+
"scene": "smart_crop",
|
381
|
+
"width": 240,
|
382
|
+
"height": 240,
|
383
|
+
"uniq_key": "smart_crop-w:240-h:240",
|
384
|
+
"format": "webp"
|
385
|
+
},
|
386
|
+
{
|
387
|
+
"scene": "smart_crop",
|
388
|
+
"width": 320,
|
389
|
+
"height": 320,
|
390
|
+
"uniq_key": "smart_crop-w:320-h:320",
|
391
|
+
"format": "webp"
|
392
|
+
},
|
393
|
+
{
|
394
|
+
"scene": "smart_crop",
|
395
|
+
"width": 480,
|
396
|
+
"height": 480,
|
397
|
+
"uniq_key": "smart_crop-w:480-h:480",
|
398
|
+
"format": "webp"
|
399
|
+
},
|
400
|
+
{
|
401
|
+
"scene": "smart_crop",
|
402
|
+
"width": 480,
|
403
|
+
"height": 320,
|
404
|
+
"uniq_key": "smart_crop-w:480-h:320",
|
405
|
+
"format": "webp"
|
406
|
+
},
|
407
|
+
{
|
408
|
+
"scene": "smart_crop",
|
409
|
+
"width": 240,
|
410
|
+
"height": 160,
|
411
|
+
"uniq_key": "smart_crop-w:240-h:160",
|
412
|
+
"format": "webp"
|
413
|
+
},
|
414
|
+
{
|
415
|
+
"scene": "smart_crop",
|
416
|
+
"width": 160,
|
417
|
+
"height": 213,
|
418
|
+
"uniq_key": "smart_crop-w:160-h:213",
|
419
|
+
"format": "webp"
|
420
|
+
},
|
421
|
+
{
|
422
|
+
"scene": "smart_crop",
|
423
|
+
"width": 320,
|
424
|
+
"height": 427,
|
425
|
+
"uniq_key": "smart_crop-w:320-h:427",
|
426
|
+
"format": "webp"
|
427
|
+
},
|
428
|
+
{
|
429
|
+
"scene": "loss",
|
430
|
+
"width": 1080,
|
431
|
+
"height": 1080,
|
432
|
+
"uniq_key": "1080",
|
433
|
+
"format": "webp"
|
434
|
+
},
|
435
|
+
{
|
436
|
+
"scene": "loss",
|
437
|
+
"width": 900,
|
438
|
+
"height": 900,
|
439
|
+
"uniq_key": "900",
|
440
|
+
"format": "webp"
|
441
|
+
},
|
442
|
+
{
|
443
|
+
"scene": "loss",
|
444
|
+
"width": 720,
|
445
|
+
"height": 720,
|
446
|
+
"uniq_key": "720",
|
447
|
+
"format": "webp"
|
448
|
+
},
|
449
|
+
{
|
450
|
+
"scene": "loss",
|
451
|
+
"width": 480,
|
452
|
+
"height": 480,
|
453
|
+
"uniq_key": "480",
|
454
|
+
"format": "webp"
|
455
|
+
},
|
456
|
+
{
|
457
|
+
"scene": "loss",
|
458
|
+
"width": 360,
|
459
|
+
"height": 360,
|
460
|
+
"uniq_key": "360",
|
461
|
+
"format": "webp"
|
462
|
+
},
|
463
|
+
{
|
464
|
+
"scene": "normal",
|
465
|
+
"width": 2400,
|
466
|
+
"height": 2400,
|
467
|
+
"uniq_key": "2400",
|
468
|
+
"format": "webp"
|
469
|
+
}
|
470
|
+
]
|
471
|
+
},
|
472
|
+
"origin_image_info": {
|
473
|
+
"width": 96,
|
474
|
+
"format": "webp",
|
475
|
+
"image_scene_list": [
|
476
|
+
{
|
477
|
+
"scene": "smart_crop",
|
478
|
+
"width": 240,
|
479
|
+
"height": 240,
|
480
|
+
"uniq_key": "smart_crop-w:240-h:240",
|
481
|
+
"format": "webp"
|
482
|
+
},
|
483
|
+
{
|
484
|
+
"scene": "smart_crop",
|
485
|
+
"width": 320,
|
486
|
+
"height": 320,
|
487
|
+
"uniq_key": "smart_crop-w:320-h:320",
|
488
|
+
"format": "webp"
|
489
|
+
},
|
490
|
+
{
|
491
|
+
"scene": "smart_crop",
|
492
|
+
"width": 480,
|
493
|
+
"height": 480,
|
494
|
+
"uniq_key": "smart_crop-w:480-h:480",
|
495
|
+
"format": "webp"
|
496
|
+
},
|
497
|
+
{
|
498
|
+
"scene": "smart_crop",
|
499
|
+
"width": 480,
|
500
|
+
"height": 320,
|
501
|
+
"uniq_key": "smart_crop-w:480-h:320",
|
502
|
+
"format": "webp"
|
503
|
+
},
|
504
|
+
{
|
505
|
+
"scene": "smart_crop",
|
506
|
+
"width": 240,
|
507
|
+
"height": 160,
|
508
|
+
"uniq_key": "smart_crop-w:240-h:160",
|
509
|
+
"format": "webp"
|
510
|
+
},
|
511
|
+
{
|
512
|
+
"scene": "smart_crop",
|
513
|
+
"width": 160,
|
514
|
+
"height": 213,
|
515
|
+
"uniq_key": "smart_crop-w:160-h:213",
|
516
|
+
"format": "webp"
|
517
|
+
},
|
518
|
+
{
|
519
|
+
"scene": "smart_crop",
|
520
|
+
"width": 320,
|
521
|
+
"height": 427,
|
522
|
+
"uniq_key": "smart_crop-w:320-h:427",
|
523
|
+
"format": "webp"
|
524
|
+
},
|
525
|
+
{
|
526
|
+
"scene": "loss",
|
527
|
+
"width": 1080,
|
528
|
+
"height": 1080,
|
529
|
+
"uniq_key": "1080",
|
530
|
+
"format": "webp"
|
531
|
+
},
|
532
|
+
{
|
533
|
+
"scene": "loss",
|
534
|
+
"width": 900,
|
535
|
+
"height": 900,
|
536
|
+
"uniq_key": "900",
|
537
|
+
"format": "webp"
|
538
|
+
},
|
539
|
+
{
|
540
|
+
"scene": "loss",
|
541
|
+
"width": 720,
|
542
|
+
"height": 720,
|
543
|
+
"uniq_key": "720",
|
544
|
+
"format": "webp"
|
545
|
+
},
|
546
|
+
{
|
547
|
+
"scene": "loss",
|
548
|
+
"width": 480,
|
549
|
+
"height": 480,
|
550
|
+
"uniq_key": "480",
|
551
|
+
"format": "webp"
|
552
|
+
},
|
553
|
+
{
|
554
|
+
"scene": "loss",
|
555
|
+
"width": 360,
|
556
|
+
"height": 360,
|
557
|
+
"uniq_key": "360",
|
558
|
+
"format": "webp"
|
559
|
+
},
|
560
|
+
{
|
561
|
+
"scene": "normal",
|
562
|
+
"width": 2400,
|
563
|
+
"height": 2400,
|
564
|
+
"uniq_key": "2400",
|
565
|
+
"format": "webp"
|
566
|
+
}
|
567
|
+
]
|
568
|
+
},
|
569
|
+
"history_option": {
|
570
|
+
"story_id": "",
|
571
|
+
"multi_size_image_config": [
|
572
|
+
{
|
573
|
+
"height": 100,
|
574
|
+
"width": 100,
|
575
|
+
"format": "webp"
|
576
|
+
},
|
577
|
+
{
|
578
|
+
"height": 360,
|
579
|
+
"width": 360,
|
580
|
+
"format": "webp"
|
581
|
+
},
|
582
|
+
{
|
583
|
+
"height": 720,
|
584
|
+
"width": 720,
|
585
|
+
"format": "webp"
|
586
|
+
}
|
587
|
+
]
|
588
|
+
},
|
589
|
+
"is_pack_origin": True
|
590
|
+
}
|
591
|
+
|
592
|
+
async with httpx.AsyncClient(base_url=BASE_URL, headers=headers, timeout=60) as client:
|
593
|
+
response = await client.post(url, json=payload, params=params)
|
594
|
+
response.raise_for_status()
|
595
|
+
|
596
|
+
return response.json()
|
597
|
+
|
598
|
+
|
340
599
|
# @cache: todo: cache 积分异常消耗
|
341
600
|
# @cache(ttl=3600)
|
342
601
|
async def generate(request: ImageRequest):
|
@@ -402,7 +661,7 @@ if __name__ == '__main__':
|
|
402
661
|
|
403
662
|
# arun(generate(ImageRequest(prompt="fuck you")))
|
404
663
|
prompt = "A plump Chinese beauty wearing a wedding dress revealing her skirt and underwear is swinging on the swing,Happy smile,cleavage,Exposed thighs,Spread your legs open,Extend your leg,panties,upskirt,Barefoot,sole"
|
405
|
-
prompt = "a dog cat in the same room
|
664
|
+
prompt = "a dog cat in the same room"
|
406
665
|
# prompt = "https://oss.ffire.cc/files/kling_watermark.png 让这个女人带上墨镜,衣服换个颜色... "
|
407
666
|
request = ImageRequest(prompt=prompt, size="1328x1328")
|
408
667
|
# request = ImageRequest(prompt=prompt, size="1024x1024")
|
@@ -410,10 +669,13 @@ if __name__ == '__main__':
|
|
410
669
|
# request = ImageRequest(prompt=prompt, size="2048*2048")
|
411
670
|
|
412
671
|
# task = arun(create_task(request, "7d9969ffd8ad2edda7da8fff11cb9434"))
|
413
|
-
task = arun(create_task(request, "
|
414
|
-
|
672
|
+
# task = arun(create_task(request, "d2d142fc877e696484cc2fc521127b36"))
|
673
|
+
#
|
415
674
|
# arun(get_task(task.task_id, task.system_fingerprint))
|
416
675
|
|
676
|
+
arun(get_task('16279716197378', 'd2d142fc877e696484cc2fc521127b36'))
|
677
|
+
arun(get_task_plus('16279716197378', 'd2d142fc877e696484cc2fc521127b36'))
|
678
|
+
|
417
679
|
# TaskResponse(task_id='16127190069506', code=0, message=None, status='SUBMITTED', data=None,
|
418
680
|
# system_fingerprint='8089661372fe8db9795cc507c3049625', model=None,
|
419
681
|
# created_at='2025-05-06T19:49:50.933089')
|
meutils/data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2025.05.
|
1
|
+
2025.05.12.15.21.44
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
# @Project : AI. @by PyCharm
|
4
|
+
# @File : todo
|
5
|
+
# @Time : 2025/5/12 13:32
|
6
|
+
# @Author : betterme
|
7
|
+
# @WeChat : meutils
|
8
|
+
# @Software : PyCharm
|
9
|
+
# @Description :
|
10
|
+
|
11
|
+
from meutils.pipe import *
|
12
|
+
|
13
|
+
"""
|
14
|
+
400 {"code":20015,"message":"length of prompt_tokens (213479) must be less than max_seq_len (65536).","data":null}
|
15
|
+
"""
|