bizyengine 1.2.66__py3-none-any.whl → 1.2.68__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.
@@ -871,7 +871,7 @@ class BizyAirServer:
871
871
  ),
872
872
  "bizyait-image-gen": MCPServerConfig(
873
873
  transport="streamable_http",
874
- url="https://api.bizyair.cn/w/v1/mcp/33",
874
+ url="https://api.bizyair.cn/w/v1/mcp/67",
875
875
  headers={
876
876
  "Authorization": "Bearer " + api_key,
877
877
  "X-BizyBot-Client": "bizybot",
@@ -879,7 +879,7 @@ class BizyAirServer:
879
879
  ),
880
880
  "bizyait-image-edit": MCPServerConfig(
881
881
  transport="streamable_http",
882
- url="https://api.bizyair.cn/w/v1/mcp/34",
882
+ url="https://api.bizyair.cn/w/v1/mcp/68",
883
883
  headers={
884
884
  "Authorization": "Bearer " + api_key,
885
885
  "X-BizyBot-Client": "bizybot",
@@ -463,3 +463,143 @@ class NanoBananaPro(BizyAirBaseNode):
463
463
  except Exception as e:
464
464
  logging.error(f"Gemini API error: {e}")
465
465
  raise e
466
+
467
+
468
+ class NanoBananaProOfficial(BizyAirBaseNode):
469
+ @classmethod
470
+ def INPUT_TYPES(s):
471
+ return {
472
+ "required": {
473
+ "prompt": (
474
+ "STRING",
475
+ {
476
+ "multiline": True,
477
+ "default": "",
478
+ },
479
+ ),
480
+ "temperature": (
481
+ "FLOAT",
482
+ {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.05},
483
+ ),
484
+ "top_p": (
485
+ "FLOAT",
486
+ {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.05},
487
+ ),
488
+ "seed": ("INT", {"default": 0, "min": 0, "max": 2147483647}),
489
+ "max_tokens": ("INT", {"default": 32768, "min": 1, "max": 32768}),
490
+ "aspect_ratio": (
491
+ [
492
+ "1:1",
493
+ "2:3",
494
+ "3:2",
495
+ "3:4",
496
+ "4:3",
497
+ "4:5",
498
+ "5:4",
499
+ "9:16",
500
+ "16:9",
501
+ "21:9",
502
+ "auto",
503
+ ],
504
+ {"default": "auto", "tooltip": "Output image aspect ratio"},
505
+ ),
506
+ "resolution": (["1K", "2K", "4K", "auto"], {"default": "auto"}),
507
+ },
508
+ "optional": {
509
+ "images": ("IMAGE",),
510
+ },
511
+ }
512
+
513
+ RETURN_TYPES = ("IMAGE", "STRING")
514
+ FUNCTION = "execute"
515
+ OUTPUT_NODE = False
516
+ CATEGORY = "☁️BizyAir/External APIs/Gemini"
517
+ NODE_DISPLAY_NAME = "NanoBananaPro (Official Parameters)"
518
+
519
+ def execute(
520
+ self,
521
+ prompt,
522
+ temperature,
523
+ top_p,
524
+ seed,
525
+ max_tokens,
526
+ aspect_ratio,
527
+ resolution,
528
+ images=None,
529
+ **kwargs,
530
+ ):
531
+ try:
532
+ url = f"{BIZYAIR_SERVER_ADDRESS}/proxy_inference/VertexAI/gemini-3-pro-image-preview"
533
+ extra_data = pop_api_key_and_prompt_id(kwargs)
534
+
535
+ if images is not None and len(images) > 14:
536
+ raise ValueError("Maximum number of images is 14")
537
+ parts = [{"text": prompt}]
538
+ for batch_number, image in enumerate(images if images is not None else []):
539
+ if image is not None:
540
+ parts.append(
541
+ {
542
+ "inline_data": {
543
+ "mime_type": "image/png",
544
+ "data": tensor_to_base64_string(image),
545
+ }
546
+ }
547
+ )
548
+
549
+ image_config = {}
550
+ if resolution != "auto":
551
+ image_config["imageSize"] = resolution
552
+ if aspect_ratio != "auto":
553
+ image_config["aspectRatio"] = aspect_ratio
554
+ generation_config = {
555
+ "seed": seed,
556
+ "responseModalities": ["TEXT", "IMAGE"],
557
+ "temperature": temperature,
558
+ "topP": top_p,
559
+ "maxOutputTokens": max_tokens,
560
+ }
561
+ if image_config != {}:
562
+ generation_config["imageConfig"] = image_config
563
+ logging.info(f"Generation config: {generation_config}")
564
+ data = {
565
+ "contents": {
566
+ "parts": parts,
567
+ "role": "user",
568
+ },
569
+ "generationConfig": generation_config,
570
+ }
571
+ json_payload = json.dumps(data).encode("utf-8")
572
+ headers = client.headers(api_key=extra_data["api_key"])
573
+ headers["X-BIZYAIR-PROMPT-ID"] = extra_data[
574
+ "prompt_id"
575
+ ] # 额外参数vertexai会拒绝,所以用请求头传
576
+ resp = client.send_request(
577
+ url=url,
578
+ data=json_payload,
579
+ headers=headers,
580
+ )
581
+ # 解析潜在错误
582
+ prompt_feedback = resp.get("promptFeedback", None)
583
+ if prompt_feedback:
584
+ logging.error(f"Response: {resp}")
585
+ raise ValueError(f"Prompt blocked: {prompt_feedback}")
586
+ if len(resp.get("candidates", [])) == 0:
587
+ logging.error(f"Response: {resp}")
588
+ raise ValueError("No candidates found in response")
589
+ if resp["candidates"][0]["finishReason"] != "STOP":
590
+ logging.error(f"Response: {resp}")
591
+ raise ValueError(
592
+ f"Erroneous finish reason: {resp['candidates'][0]['finishReason']}"
593
+ )
594
+
595
+ # 解析文本
596
+ text = get_text_from_response(resp)
597
+
598
+ # 解析base64图片
599
+ image = get_image_from_response(resp)
600
+
601
+ return (image, text)
602
+
603
+ except Exception as e:
604
+ logging.error(f"Gemini API error: {e}")
605
+ raise e
bizyengine/version.txt CHANGED
@@ -1 +1 @@
1
- 1.2.66
1
+ 1.2.68
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bizyengine
3
- Version: 1.2.66
3
+ Version: 1.2.68
4
4
  Summary: [a/BizyAir](https://github.com/siliconflow/BizyAir) Comfy Nodes that can run in any environment.
5
5
  Author-email: SiliconFlow <yaochi@siliconflow.cn>
6
6
  Project-URL: Repository, https://github.com/siliconflow/BizyAir
@@ -1,5 +1,5 @@
1
1
  bizyengine/__init__.py,sha256=GP9V-JM07fz7uv_qTB43QEA2rKdrVJxi5I7LRnn_3ZQ,914
2
- bizyengine/version.txt,sha256=JfKoIMXW0UfH6cucqqNqD89qwq9gR_SqQ1Ky-4wtr3c,7
2
+ bizyengine/version.txt,sha256=HbdduS6K9a65tf03pX8egrFX17w43vvkfjj8mmwRyfs,7
3
3
  bizyengine/bizy_server/__init__.py,sha256=SP9oSblnPo4KQyh7yOGD26YCskFAcQHAZy04nQBNRIw,200
4
4
  bizyengine/bizy_server/api_client.py,sha256=Z7G5IjaEqSJkF6nLLw2R3bpgBAOi5ClQiUbel6NMXmE,43932
5
5
  bizyengine/bizy_server/errno.py,sha256=RIyvegX3lzpx_1L1q2XVvu3on0kvYgKiUQ8U3ZtyF68,16823
@@ -7,7 +7,7 @@ bizyengine/bizy_server/error_handler.py,sha256=MGrfO1AEqbfEgMWPL8B6Ypew_zHiQAdYG
7
7
  bizyengine/bizy_server/execution.py,sha256=ayaEf6eGJKQsVZV-1_UlGlvwwmlH7FEek31Uq-MbUjA,1644
8
8
  bizyengine/bizy_server/profile.py,sha256=f4juAzJ73gCm0AhagYpt9WnG8HEI6xze_U96-omBLqU,3044
9
9
  bizyengine/bizy_server/resp.py,sha256=iOFT5Ud7VJBP2uqkojJIgc3y2ifMjjEXoj0ewneL9lc,710
10
- bizyengine/bizy_server/server.py,sha256=isOzHDk2kD6WjdlemeOA7j_xLnZ2vat_NvE1I0bsOFw,57490
10
+ bizyengine/bizy_server/server.py,sha256=ZLWTDRtTGV601JGcJYJsp_NUgsJyKoDdR7KrStLzW5g,57490
11
11
  bizyengine/bizy_server/stream_response.py,sha256=H2XHqlVRtQMhgdztAuG7l8-iV_Pm42u2x6WJ0gNVIW0,9654
12
12
  bizyengine/bizy_server/utils.py,sha256=t3y3ZTDzFa8K4wXlzgLVaFNCizgylsKsd9K3rLL4sGw,3986
13
13
  bizyengine/bizyair_extras/__init__.py,sha256=GNmQ3C0fG8pIGgAMV6M9Jp89fOOVd-YpsLOuIWgjxF4,1092
@@ -22,7 +22,7 @@ bizyengine/bizyair_extras/nodes_custom_sampler.py,sha256=NK-7sdcp8oxJisjTEFfBskk
22
22
  bizyengine/bizyair_extras/nodes_dataset.py,sha256=htF0YZb_FHncLhLDEbJfNCVqJ6rvlo1ZLk7iY42Rylc,3440
23
23
  bizyengine/bizyair_extras/nodes_differential_diffusion.py,sha256=nSrbD-w0XtrwktwzME5M0Vmi1sI7Z08AqwgymTdThqo,370
24
24
  bizyengine/bizyair_extras/nodes_flux.py,sha256=ls94kGBuBNgW5c6uhG36iZLk1TTM2TIoTTcpERgEE5E,2683
25
- bizyengine/bizyair_extras/nodes_gemini.py,sha256=yMngTTCmgOV3lB4Wnqi1A-qSk4MFGGTBSbe0hK-o9QE,16097
25
+ bizyengine/bizyair_extras/nodes_gemini.py,sha256=i6_YqG4n7aVdqVtDhMbNeP0SZqp21JYe1MBqISe5LPQ,21054
26
26
  bizyengine/bizyair_extras/nodes_hunyuan3d.py,sha256=dWHLeqX68N7zKnfDMzm9nutmCNtFT6-wwt7P5cPDu7Q,2058
27
27
  bizyengine/bizyair_extras/nodes_image_utils.py,sha256=BldF_CKD2M01K8-SnG-QV86u3HZqFz_GP5GrCQ5CFDQ,2875
28
28
  bizyengine/bizyair_extras/nodes_ip2p.py,sha256=GSEFJvrs4f2tv0xwYkWqc8uhsXrzAJVPvvwcw0gTjR0,619
@@ -97,7 +97,7 @@ bizyengine/misc/route_sam.py,sha256=-bMIR2QalfnszipGxSxvDAHGJa5gPSrjkYPb5baaRg4,
97
97
  bizyengine/misc/segment_anything.py,sha256=wNKYwlYPMszfwj23524geFZJjZaG4eye65SGaUnh77I,8941
98
98
  bizyengine/misc/supernode.py,sha256=STN9gaxfTSErH8OiHeZa47d8z-G9S0I7fXuJvHQOBFM,4532
99
99
  bizyengine/misc/utils.py,sha256=nXXTPkj4WBvds4EWjI9c-ydeWwmXl8Vwrdu-4Fh62g8,12914
100
- bizyengine-1.2.66.dist-info/METADATA,sha256=SV507-RvZb4rbAXDX8mWZ9Lp3n-6XK86OYaIqIEF524,735
101
- bizyengine-1.2.66.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
102
- bizyengine-1.2.66.dist-info/top_level.txt,sha256=2zapzqxX-we5cRyJkGf9bd5JinRtXp3-_uDI-xCAnc0,11
103
- bizyengine-1.2.66.dist-info/RECORD,,
100
+ bizyengine-1.2.68.dist-info/METADATA,sha256=Oa5rQmsMtWg65jmjiT9yqhUzCFORl4VbAuf4sisMjVY,735
101
+ bizyengine-1.2.68.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
102
+ bizyengine-1.2.68.dist-info/top_level.txt,sha256=2zapzqxX-we5cRyJkGf9bd5JinRtXp3-_uDI-xCAnc0,11
103
+ bizyengine-1.2.68.dist-info/RECORD,,