V 2.0.0 - Universal api #38 - import modules and json validation

This commit is contained in:
DESKTOP-TVBJISQ\Primere
2026-03-01 12:16:40 +01:00
parent 9d7211c094
commit 741d851516
8 changed files with 458 additions and 249 deletions
+170 -170
View File
@@ -37,7 +37,7 @@
"widgets_values": [
"Random",
42,
"Last seed: [772579893417631]"
"Last seed: [499771936453052]"
],
"color": "#223",
"bgcolor": "#335"
@@ -101,7 +101,7 @@
"ver": "ce14e5d0f46aaa12155853e05132bffb2ee70361"
},
"widgets_values": [
"<google.genai.client.Client object at 0x0000012F0013F020>"
"<google.genai.client.Client object at 0x0000022201034230>"
]
},
{
@@ -132,7 +132,7 @@
"ver": "ce14e5d0f46aaa12155853e05132bffb2ee70361"
},
"widgets_values": [
"({'schema': {'provider': 'Gemini', 'service': 'Nanobanana_V1', 'possible_parameters': {'aspect_ratio': ['1:1', '2:3', '3:2', '3:4', '4:3', '4:5', '5:4', '9:16', '16:9', '21:9'], 'resolution': ['1K', '2K', '4K'], 'model': ['gemini-3-pro-image-preview', 'gemini-2.5-flash-image']}, 'request': {'method': 'SDK', 'endpoint': 'client.models.generate_content', 'sdk_call': {'args': [], 'kwargs': {'model': '{{model}}', 'contents': ['{{prompt}}', '{{reference_images}}'], 'config': {'$call': 'types.GenerateContentConfig', '$args': [], '$kwargs': {'response_modalities': ['{{config_response_modalities_0}}'], 'image_config': {'$call': 'types.ImageConfig', '$args': [], '$kwargs': {'aspect_ratio': '{{aspect_ratio}}', 'image_size': '{{image_size}}'}}}}}}}}, 'selected_parameters': {'height': 810, 'debug_mode': False, 'batch': 1, 'aspect_ratio': '3:2', 'seed': 772579893417631, 'width': 1295, 'prompt': \"The woman is sitting on the barstool closest to the viewer in the blue kitchen. Paint her hair red, give her a glass of champagne, and dress her in a black leather jacket with the zipper pulled down to reveal a white T-shirt underneath. Place a baseball cap on her head. She is wearing black jeans and a black belt. She is also wearing an elegant, silky, red women's neck scarf. Place the porcelain vase on the kitchen table. She holds a bug spray in her other hand and sprays it at a giant spider climbing on the wall. The woman is frightened. Her dog barks at the spider. Keep everything else unchanged. Follow all attached reference images.\", 'resolution': '1K', 'model': 'gemini-2.5-flash-image'}, 'used_values': {'aspect_ratio': '3:2', 'config_response_modalities_0': 'IMAGE', 'image_size': '1K', 'model': 'gemini-2.5-flash-image', 'prompt': \"The woman is sitting on the barstool closest to the viewer in the blue kitchen. Paint her hair red, give her a glass of champagne, and dress her in a black leather jacket with the zipper pulled down to reveal a white T-shirt underneath. Place a baseball cap on her head. She is wearing black jeans and a black belt. She is also wearing an elegant, silky, red women's neck scarf. Place the porcelain vase on the kitchen table. She holds a bug spray in her other hand and sprays it at a giant spider climbing on the wall. The woman is frightened. Her dog barks at the spider. Keep everything else unchanged. Follow all attached reference images.\", 'reference_images': 'default_reference_images'}, 'selected_service': 'Nanobanana_V1', 'rendered': {'provider': 'Gemini', 'endpoint': 'client.models.generate_content', 'method': 'SDK', 'headers': {}, 'query': {}, 'body': None, 'sdk_call': {'args': [], 'kwargs': {'model': 'gemini-2.5-flash-image', 'contents': [\"The woman is sitting on the barstool closest to the viewer in the blue kitchen. Paint her hair red, give her a glass of champagne, and dress her in a black leather jacket with the zipper pulled down to reveal a white T-shirt underneath. Place a baseball cap on her head. She is wearing black jeans and a black belt. She is also wearing an elegant, silky, red women's neck scarf. Place the porcelain vase on the kitchen table. She holds a bug spray in her other hand and sprays it at a giant spider climbing on the wall. The woman is frightened. Her dog barks at the spider. Keep everything else unchanged. Follow all attached reference images.\", 'default_reference_images'], 'config': {'$call': 'types.GenerateContentConfig', '$args': [], '$kwargs': {'response_modalities': ['IMAGE'], 'image_config': {'$call': 'types.ImageConfig', '$args': [], '$kwargs': {'aspect_ratio': '3:2', 'image_size': '1K'}}}}}}}, 'api_result': GenerateContentResponse(\n automatic_function_calling_history=[],\n candidates=[\n Candidate(\n content=Content(\n parts=[\n Part(\n inline_data=Blob(\n data=<... Max depth ...>,\n mime_type=<... Max depth ...>\n )\n ),\n ],\n role='model'\n ),\n finish_reason=<FinishReason.STOP: 'STOP'>,\n index=0\n ),\n ],\n model_version='gemini-2.5-flash-image',\n response_id='ND-jaeqwOMyynsEP7Oqx8A4',\n sdk_http_response=HttpResponse(\n headers=<dict len=11>\n ),\n usage_metadata=GenerateContentResponseUsageMetadata(\n candidates_token_count=1290,\n candidates_tokens_details=[\n ModalityTokenCount(\n modality=<MediaModality.IMAGE: 'IMAGE'>,\n token_count=1290\n ),\n ],\n prompt_token_count=145,\n prompt_tokens_details=[\n ModalityTokenCount(\n modality=<MediaModality.TEXT: 'TEXT'>,\n token_count=145\n ),\n ],\n total_token_count=1435\n )\n), 'api_error': None},)"
"None"
]
},
{
@@ -163,7 +163,7 @@
"ver": "ce14e5d0f46aaa12155853e05132bffb2ee70361"
},
"widgets_values": [
"{\n \"provider\": \"Gemini\",\n \"endpoint\": \"client.models.generate_content\",\n \"method\": \"SDK\",\n \"headers\": {},\n \"query\": {},\n \"body\": null,\n \"sdk_call\": {\n \"args\": [],\n \"kwargs\": {\n \"model\": \"gemini-2.5-flash-image\",\n \"contents\": [\n \"The woman is sitting on the barstool closest to the viewer in the blue kitchen. Paint her hair red, give her a glass of champagne, and dress her in a black leather jacket with the zipper pulled down to reveal a white T-shirt underneath. Place a baseball cap on her head. She is wearing black jeans and a black belt. She is also wearing an elegant, silky, red women's neck scarf. Place the porcelain vase on the kitchen table. She holds a bug spray in her other hand and sprays it at a giant spider climbing on the wall. The woman is frightened. Her dog barks at the spider. Keep everything else unchanged. Follow all attached reference images.\",\n \"default_reference_images\"\n ],\n \"config\": {\n \"$call\": \"types.GenerateContentConfig\",\n \"$args\": [],\n \"$kwargs\": {\n \"response_modalities\": [\n \"IMAGE\"\n ],\n \"image_config\": {\n \"$call\": \"types.ImageConfig\",\n \"$args\": [],\n \"$kwargs\": {\n \"aspect_ratio\": \"3:2\",\n \"image_size\": \"1K\"\n }\n }\n }\n }\n }\n }\n}"
"{\n \"provider\": \"Gemini\",\n \"endpoint\": \"client.models.generate_content\",\n \"method\": \"SDK\",\n \"headers\": {},\n \"query\": {},\n \"body\": null,\n \"sdk_call\": {\n \"args\": [],\n \"kwargs\": {\n \"model\": \"gemini-2.5-flash-image\",\n \"contents\": [\n \"The woman is sitting on the barstool closest to the viewer in the blue kitchen. Paint her hair red, give her a glass of champagne, and dress her in a black leather jacket with the zipper pulled down to reveal a white T-shirt underneath. Place a baseball cap on her head. She is wearing black jeans and a black belt. She is also wearing an elegant, silky, red women's neck scarf. Place the porcelain vase on the kitchen table. She holds a bug spray in her other hand and sprays it at a giant spider climbing on the wall. The woman is frightened. Her dog barks at the spider. Keep everything else unchanged. Follow all attached reference images.\",\n \"default_reference_images\"\n ],\n \"config\": {\n \"$call\": \"types.GenerateContentConfig\",\n \"$args\": [],\n \"$kwargs\": {\n \"response_modalities\": [\n \"IMAGE\"\n ],\n \"image_config\": {\n \"$call\": \"types.ImageConfig\",\n \"$args\": [],\n \"$kwargs\": {\n \"aspect_ratio\": \"16:9\",\n \"image_size\": \"1K\"\n }\n }\n }\n }\n }\n }\n}"
],
"color": "#322",
"bgcolor": "#533"
@@ -196,7 +196,7 @@
"ver": "ce14e5d0f46aaa12155853e05132bffb2ee70361"
},
"widgets_values": [
"{\n \"provider\": \"Gemini\",\n \"service\": \"Nanobanana_V1\",\n \"possible_parameters\": {\n \"aspect_ratio\": [\n \"1:1\",\n \"2:3\",\n \"3:2\",\n \"3:4\",\n \"4:3\",\n \"4:5\",\n \"5:4\",\n \"9:16\",\n \"16:9\",\n \"21:9\"\n ],\n \"resolution\": [\n \"1K\",\n \"2K\",\n \"4K\"\n ],\n \"model\": [\n \"gemini-3-pro-image-preview\",\n \"gemini-2.5-flash-image\"\n ]\n },\n \"request\": {\n \"method\": \"SDK\",\n \"endpoint\": \"client.models.generate_content\",\n \"sdk_call\": {\n \"args\": [],\n \"kwargs\": {\n \"model\": \"{{model}}\",\n \"contents\": [\n \"{{prompt}}\",\n \"{{reference_images}}\"\n ],\n \"config\": {\n \"$call\": \"types.GenerateContentConfig\",\n \"$args\": [],\n \"$kwargs\": {\n \"response_modalities\": [\n \"{{config_response_modalities_0}}\"\n ],\n \"image_config\": {\n \"$call\": \"types.ImageConfig\",\n \"$args\": [],\n \"$kwargs\": {\n \"aspect_ratio\": \"{{aspect_ratio}}\",\n \"image_size\": \"{{image_size}}\"\n }\n }\n }\n }\n }\n }\n }\n}"
"{\n \"provider\": \"Gemini\",\n \"service\": \"Nanobanana_V1\",\n \"response_handler\": \"Gemini_Nanobanana.py\",\n \"import_modules\": [\n \"from google import genai\",\n \"from google.genai import types\"\n ],\n \"possible_parameters\": {\n \"aspect_ratio\": [\n \"1:1\",\n \"2:3\",\n \"3:2\",\n \"3:4\",\n \"4:3\",\n \"4:5\",\n \"5:4\",\n \"9:16\",\n \"16:9\",\n \"21:9\"\n ],\n \"resolution\": [\n \"1K\",\n \"2K\",\n \"4K\"\n ],\n \"model\": [\n \"gemini-3-pro-image-preview\",\n \"gemini-2.5-flash-image\"\n ]\n },\n \"request\": {\n \"method\": \"SDK\",\n \"endpoint\": \"client.models.generate_content\",\n \"sdk_call\": {\n \"args\": [],\n \"kwargs\": {\n \"model\": \"{{model}}\",\n \"contents\": [\n \"{{prompt}}\",\n \"{{reference_images}}\"\n ],\n \"config\": {\n \"$call\": \"types.GenerateContentConfig\",\n \"$args\": [],\n \"$kwargs\": {\n \"response_modalities\": [\n \"{{config_response_modalities_0}}\"\n ],\n \"image_config\": {\n \"$call\": \"types.ImageConfig\",\n \"$args\": [],\n \"$kwargs\": {\n \"aspect_ratio\": \"{{aspect_ratio}}\",\n \"image_size\": \"{{image_size}}\"\n }\n }\n }\n }\n }\n }\n }\n}"
],
"color": "#322",
"bgcolor": "#533"
@@ -229,7 +229,7 @@
"ver": "ce14e5d0f46aaa12155853e05132bffb2ee70361"
},
"widgets_values": [
"sdk_http_response=HttpResponse(\n headers=<dict len=11>\n) candidates=[Candidate(\n content=Content(\n parts=[\n Part(\n inline_data=Blob(\n data=b'\\x89PNG\\r\\n\\x1a\\n\\x00\\x00\\x00\\rIHDR\\x00\\x00\\x04\\xe0\\x00\\x00\\x03@\\x08\\x02\\x00\\x00\\x00\\rb\\x85G\\x00\\x00\\x17\\x7fcaBX\\x00\\x00\\x17\\x7fjumb\\x00\\x00\\x00\\x1ejumdc2pa\\x00\\x11\\x00\\x10\\x80\\x00\\x00\\xaa\\x008\\x9bq\\x03c2pa\\x00\\x00\\x00\\x17Yjumb\\x00\\x00\\x00Gjumdc2...',\n mime_type='image/png'\n )\n ),\n ],\n role='model'\n ),\n finish_reason=<FinishReason.STOP: 'STOP'>,\n index=0\n)] create_time=None model_version='gemini-2.5-flash-image' prompt_feedback=None response_id='ND-jaeqwOMyynsEP7Oqx8A4' usage_metadata=GenerateContentResponseUsageMetadata(\n candidates_token_count=1290,\n candidates_tokens_details=[\n ModalityTokenCount(\n modality=<MediaModality.IMAGE: 'IMAGE'>,\n token_count=1290\n ),\n ],\n prompt_token_count=145,\n prompt_tokens_details=[\n ModalityTokenCount(\n modality=<MediaModality.TEXT: 'TEXT'>,\n token_count=145\n ),\n ],\n total_token_count=1435\n) automatic_function_calling_history=[] parsed=None"
"None"
]
},
{
@@ -273,74 +273,6 @@
"color": "#432",
"bgcolor": "#653"
},
{
"id": 42,
"type": "PreviewImage",
"pos": [
-1911.866591853913,
-1189.5097461843127
],
"size": [
2324.0069677273495,
581.7454612396214
],
"flags": {},
"order": 16,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 205
}
],
"outputs": [],
"properties": {
"Node name for S&R": "PreviewImage"
},
"widgets_values": []
},
{
"id": 39,
"type": "LoadImage",
"pos": [
-1033.4287346830292,
604.5107392434782
],
"size": [
412.12756911804206,
508.84732322692867
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
206
]
},
{
"name": "MASK",
"type": "MASK",
"links": null
}
],
"properties": {
"Node name for S&R": "LoadImage",
"cnr_id": "comfy-core",
"ver": "0.14.1"
},
"widgets_values": [
"tmpbncl5y7d.png",
"image"
],
"color": "#432",
"bgcolor": "#653"
},
{
"id": 22,
"type": "LoadImage",
@@ -353,7 +285,7 @@
508.84732322692867
],
"flags": {},
"order": 3,
"order": 2,
"mode": 0,
"inputs": [],
"outputs": [
@@ -394,8 +326,8 @@
508.84732322692867
],
"flags": {},
"order": 4,
"mode": 0,
"order": 3,
"mode": 4,
"inputs": [],
"outputs": [
{
@@ -435,8 +367,8 @@
508.84732322692867
],
"flags": {},
"order": 5,
"mode": 0,
"order": 4,
"mode": 4,
"inputs": [],
"outputs": [
{
@@ -476,8 +408,8 @@
508.84732322692867
],
"flags": {},
"order": 6,
"mode": 0,
"order": 5,
"mode": 4,
"inputs": [],
"outputs": [
{
@@ -517,8 +449,8 @@
508.84732322692867
],
"flags": {},
"order": 7,
"mode": 0,
"order": 6,
"mode": 4,
"inputs": [],
"outputs": [
{
@@ -558,8 +490,8 @@
508.84732322692867
],
"flags": {},
"order": 8,
"mode": 0,
"order": 7,
"mode": 4,
"inputs": [],
"outputs": [
{
@@ -599,8 +531,8 @@
508.84732322692867
],
"flags": {},
"order": 9,
"mode": 0,
"order": 8,
"mode": 4,
"inputs": [],
"outputs": [
{
@@ -640,8 +572,8 @@
508.84732322692867
],
"flags": {},
"order": 10,
"mode": 0,
"order": 9,
"mode": 4,
"inputs": [],
"outputs": [
{
@@ -669,47 +601,6 @@
"color": "#432",
"bgcolor": "#653"
},
{
"id": 18,
"type": "LoadImage",
"pos": [
-1463.6929609110477,
-541.514916458471
],
"size": [
412.12756911804206,
508.84732322692867
],
"flags": {},
"order": 11,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
215
]
},
{
"name": "MASK",
"type": "MASK",
"links": null
}
],
"properties": {
"Node name for S&R": "LoadImage",
"cnr_id": "comfy-core",
"ver": "0.14.1"
},
"widgets_values": [
"348368277_936696344247420_4680049320151257292_n.jpg",
"image"
],
"color": "#432",
"bgcolor": "#653"
},
{
"id": 27,
"type": "PrimerePreviewImage",
@@ -748,6 +639,150 @@
null
]
},
{
"id": 9,
"type": "PrimitiveStringMultiline",
"pos": [
439.38399502500954,
-229.56518868321555
],
"size": [
675.7824161328128,
338.0025676349712
],
"flags": {},
"order": 10,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": [
190
]
}
],
"properties": {
"Node name for S&R": "PrimitiveStringMultiline",
"cnr_id": "comfy-core",
"ver": "0.14.1"
},
"widgets_values": [
"The woman is sitting on the barstool closest to the viewer in the blue kitchen. Paint her hair red, give her a glass of champagne, and dress her in a black leather jacket with the zipper pulled down to reveal a white T-shirt underneath. Place a baseball cap on her head. She is wearing black jeans and a black belt. She is also wearing an elegant, silky, red women's neck scarf. Place the porcelain vase on the kitchen table. She holds a bug spray in her other hand and sprays it at a giant spider climbing on the wall. The woman is frightened. Her dog barks at the spider. Keep everything else unchanged. Follow all attached reference images."
],
"color": "#232",
"bgcolor": "#353"
},
{
"id": 18,
"type": "LoadImage",
"pos": [
-1463.6929609110477,
-541.514916458471
],
"size": [
412.12756911804206,
508.84732322692867
],
"flags": {},
"order": 11,
"mode": 4,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
215
]
},
{
"name": "MASK",
"type": "MASK",
"links": null
}
],
"properties": {
"Node name for S&R": "LoadImage",
"cnr_id": "comfy-core",
"ver": "0.14.1"
},
"widgets_values": [
"348368277_936696344247420_4680049320151257292_n.jpg",
"image"
],
"color": "#432",
"bgcolor": "#653"
},
{
"id": 42,
"type": "PreviewImage",
"pos": [
-1911.866591853913,
-1189.5097461843127
],
"size": [
2324.0069677273495,
581.7454612396214
],
"flags": {},
"order": 16,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 205
}
],
"outputs": [],
"properties": {
"Node name for S&R": "PreviewImage"
},
"widgets_values": []
},
{
"id": 39,
"type": "LoadImage",
"pos": [
-1033.4287346830292,
604.5107392434782
],
"size": [
412.12756911804206,
508.84732322692867
],
"flags": {},
"order": 12,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
206
]
},
{
"name": "MASK",
"type": "MASK",
"links": null
}
],
"properties": {
"Node name for S&R": "LoadImage",
"cnr_id": "comfy-core",
"ver": "0.14.1"
},
"widgets_values": [
"tmpbncl5y7d.png",
"image"
],
"color": "#432",
"bgcolor": "#653"
},
{
"id": 17,
"type": "PrimereMultiImage",
@@ -877,41 +912,6 @@
"color": "#432",
"bgcolor": "#653"
},
{
"id": 9,
"type": "PrimitiveStringMultiline",
"pos": [
439.38399502500954,
-229.56518868321555
],
"size": [
675.7824161328128,
338.0025676349712
],
"flags": {},
"order": 12,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": [
190
]
}
],
"properties": {
"Node name for S&R": "PrimitiveStringMultiline",
"cnr_id": "comfy-core",
"ver": "0.14.1"
},
"widgets_values": [
"The woman is sitting on the barstool closest to the viewer in the blue kitchen. Paint her hair red, give her a glass of champagne, and dress her in a black leather jacket with the zipper pulled down to reveal a white T-shirt underneath. Place a baseball cap on her head. She is wearing black jeans and a black belt. She is also wearing an elegant, silky, red women's neck scarf. Place the porcelain vase on the kitchen table. She holds a bug spray in her other hand and sprays it at a giant spider climbing on the wall. The woman is frightened. Her dog barks at the spider. Keep everything else unchanged. Follow all attached reference images."
],
"color": "#232",
"bgcolor": "#353"
},
{
"id": 15,
"type": "PrimereResolution",
@@ -981,7 +981,7 @@
},
"widgets_values": [
"HD+ screen [16:10]",
false,
true,
1024,
false,
"Horizontal",
@@ -1001,7 +1001,7 @@
-548.3233034269158
],
"size": [
670.1635931396486,
648.737226759225,
482
],
"flags": {},
@@ -1345,10 +1345,10 @@
"config": {},
"extra": {
"ds": {
"scale": 0.5644739300537774,
"scale": 0.5644739300537776,
"offset": [
1409.1471240538765,
958.9479125085975
1803.7626251739487,
803.8351710145441
]
},
"frontendVersion": "1.39.19"