Image to Script to Kling Video Generation
Upload an image to automatically generate a descriptive script. This script is then used to create a video with the Kling 3.0 Omni model.
简介
This ComfyUI workflow, titled 'Image to Script to Kling Video Generation,' is designed to transform a static image into a dynamic video using advanced AI models. The process begins with uploading an image, which the system analyzes to create a descriptive script. This script serves as the foundation for generating a video using the Kling 3.0 Omni model.
The workflow leverages several nodes, including the GeminiNanoBanana2 for script generation and the KlingOmniProImageToVideoNode for video creation. By utilizing these nodes, the workflow efficiently converts visual elements into a narrative and then into a moving picture, providing a seamless transition from image to video.
你需要提供
- 正在读取工作流
在 ComfyUI 中运行。 此工作流无法在本页面运行。你可以在 Comfy Cloud 中打开(已预先加载所需内容),或下载后在自己的 ComfyUI 中使用。
在 Cloud 中试用查看工作流内部
节点图的只读预览。在 Comfy Cloud 中打开或下载后即可编辑节点。
Loading the graph
Open full-size workflow preview- 作者
- ComfyUI
需要自定义节点
- 正在读取工作流
通过代码使用此工作流
尽可能根据工作流图和输入自动生成代码,否则显示已保存的示例。运行代码可能产生费用,请先核对凭据和端点。
What you need
- Runs on
- Comfy Cloud
- 密钥
- COMFY_API_KEY
需要付费的 Cloud 方案和额度。
# Python 3.10+: pip install comfy-sdk==0.4.0
import os
from comfy_sdk import Comfy
api_key = os.environ.get("COMFY_API_KEY", "").strip()
if not api_key: raise RuntimeError("Set COMFY_API_KEY")
os.environ.setdefault("COMFY_BASE_URL", "https://cloud.comfy.org")
client = Comfy(api_key=api_key)
workflow = client.workflows.from_json({
"5": {
"class_type": "GeminiNanoBanana2",
"inputs": {
"aspect_ratio": "9:16",
"images": [
"16",
0
],
"model": "Nano Banana 2 (Gemini 3.1 Flash Image)",
"prompt": [
"36:21",
0
],
"resolution": "4K",
"response_modalities": "IMAGE",
"seed": 945201656143140,
"system_prompt": "no text overlays, text bubbles or any other dialogue visualisations. A single image.",
"thinking_level": "HIGH"
},
"_meta": {
"title": "Nano Banana 2"
}
},
"7": {
"class_type": "SaveVideo",
"inputs": {
"filename_prefix": "video/ComfyUI",
"format": "auto",
"format.codec": "auto",
"video": [
"148",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"15": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"36:21",
0
]
},
"_meta": {
"title": "Preview as Text"
}
},
"16": {
"class_type": "LoadImage",
"inputs": {
"image": "input_storyboard_video.jpg"
},
"_meta": {
"title": "Load Image"
}
},
"20": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"146",
0
]
},
"_meta": {
"title": "Preview as Text"
}
},
"23": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"37:24",
0
]
},
"_meta": {
"title": "Preview as Text"
}
},
"29": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"38:34",
0
]
},
"_meta": {
"title": "Preview as Text"
}
},
"142": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"5",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"146": {
"class_type": "GeminiNode",
"inputs": {
"images": [
"16",
0
],
"model": "gemini-3-pro-preview",
"prompt": "",
"seed": 323787791232589,
"system_prompt": "Write a 3 scene script. Extract the scenes to prompts. Each prompt has less than 512 characters. Number the prompts: A), B), C)"
},
"_meta": {
"title": "Google Gemini"
}
},
"148": {
"class_type": "KlingOmniProImageToVideoNode",
"inputs": {
"aspect_ratio": "9:16",
"duration": 12,
"generate_audio": True,
"model_name": "kling-v3-omni",
"prompt": "",
"reference_images": [
"5",
0
],
"resolution": "720p",
"seed": 205346978,
"storyboards": "3 storyboards",
"storyboards.storyboard_1_duration": 4,
"storyboards.storyboard_1_prompt": [
"36:21",
0
],
"storyboards.storyboard_2_duration": 4,
"storyboards.storyboard_2_prompt": [
"37:24",
0
],
"storyboards.storyboard_3_duration": 4,
"storyboards.storyboard_3_prompt": [
"38:34",
0
]
},
"_meta": {
"title": "Kling 3.0 Omni Image to Video"
}
},
"36:21": {
"class_type": "OpenAIChatNode",
"inputs": {
"advanced_options": [
"36:22",
0
],
"model": "gpt-5-mini",
"persist_context": False,
"prompt": [
"146",
0
]
},
"_meta": {
"title": "OpenAI ChatGPT"
}
},
"36:22": {
"class_type": "OpenAIChatConfig",
"inputs": {
"instructions": "strictly extract prompt A) only return one prompt without any explanation.",
"max_output_tokens": 4096,
"reasoning_effort": "default",
"truncation": "auto"
},
"_meta": {
"title": "OpenAI ChatGPT Advanced Options"
}
},
"37:24": {
"class_type": "OpenAIChatNode",
"inputs": {
"advanced_options": [
"37:25",
0
],
"model": "gpt-5-mini",
"persist_context": False,
"prompt": [
"146",
0
]
},
"_meta": {
"title": "OpenAI ChatGPT"
}
},
"37:25": {
"class_type": "OpenAIChatConfig",
"inputs": {
"instructions": "strictly extract prompt B) only return one prompt without any explanation.",
"max_output_tokens": 4096,
"reasoning_effort": "default",
"truncation": "auto"
},
"_meta": {
"title": "OpenAI ChatGPT Advanced Options"
}
},
"38:28": {
"class_type": "OpenAIChatConfig",
"inputs": {
"instructions": "strictly extract prompt C) only return one prompt without any explanation.",
"max_output_tokens": 4096,
"reasoning_effort": "default",
"truncation": "auto"
},
"_meta": {
"title": "OpenAI ChatGPT Advanced Options"
}
},
"38:34": {
"class_type": "OpenAIChatNode",
"inputs": {
"advanced_options": [
"38:28",
0
],
"model": "gpt-5-mini",
"persist_context": False,
"prompt": [
"146",
0
]
},
"_meta": {
"title": "OpenAI ChatGPT"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)常见问答
High-resolution images with clear subjects and defined elements work best for generating detailed scripts and dynamic videos.
Yes, you can influence the script by providing a detailed prompt when uploading your image. This helps guide the script creation process.
The workflow primarily supports common video formats like MP4, ensuring compatibility with most media players and platforms.
The time to generate a video depends on the complexity of the script and the resolution of the output, but it typically takes a few minutes.