
パラメータ
基本パラメータ
| パラメータ | 型 | デフォルト値 | 説明 |
|---|---|---|---|
| start_frame | 画像 | - | 動画に変換する入力画像 |
| prompt | 文字列 | "" | 動画の動作およびコンテンツを記述するテキストプロンプト |
| negative_prompt | 文字列 | "" | 動画に含めたくない要素 |
| cfg_scale | 浮動小数点数 | 7.0 | プロンプトへの従い具合を制御するパラメータ |
| aspect_ratio | 選択項目 | 16:9 | 出力動画のアスペクト比 |
カメラ制御パラメータ
| パラメータ | 型 | 説明 |
|---|---|---|
| camera_control | CameraControl | Kling Camera Controls ノードから取得したカメラ制御設定 |
出力
| 出力 | 型 | 説明 |
|---|---|---|
| VIDEO | 動画 | 生成された動画 |
ソースコード
[ノードソースコード (2025-05-03 更新)]
class KlingCameraControlI2VNode(KlingImage2VideoNode):
"""
Kling Image to Video Camera Control Node. This node is a image to video node, but it supports controlling the camera.
Duration, mode, and model_name request fields are hard-coded because camera control is only supported in pro mode with the kling-v1-5 model at 5s duration as of 2025-05-02.
"""
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"start_frame": model_field_to_node_input(
IO.IMAGE, KlingImage2VideoRequest, "image"
),
"prompt": model_field_to_node_input(
IO.STRING, KlingImage2VideoRequest, "prompt", multiline=True
),
"negative_prompt": model_field_to_node_input(
IO.STRING,
KlingImage2VideoRequest,
"negative_prompt",
multiline=True,
),
"cfg_scale": model_field_to_node_input(
IO.FLOAT, KlingImage2VideoRequest, "cfg_scale"
),
"aspect_ratio": model_field_to_node_input(
IO.COMBO,
KlingImage2VideoRequest,
"aspect_ratio",
enum_type=AspectRatio,
),
"camera_control": (
"CAMERA_CONTROL",
{
"tooltip": "Can be created using the Kling Camera Controls node. Controls the camera movement and motion during the video generation.",
},
),
},
"hidden": {"auth_token": "AUTH_TOKEN_COMFY_ORG"},
}
DESCRIPTION = "静止画像を、実世界の映画撮影を模したプロフェッショナルなカメラ動きを伴うシネマティックな動画に変換します。ズーム、回転、パン、チルト、ファーストパーソンビューなどの仮想カメラ操作を制御し、元の画像へのフォーカスを維持します。"
def api_call(
self,
start_frame: torch.Tensor,
prompt: str,
negative_prompt: str,
cfg_scale: float,
aspect_ratio: str,
camera_control: CameraControl,
auth_token: Optional[str] = None,
):
return super().api_call(
model_name="kling-v1-5",
start_frame=start_frame,
cfg_scale=cfg_scale,
mode="pro",
aspect_ratio=aspect_ratio,
duration="5",
prompt=prompt,
negative_prompt=negative_prompt,
camera_control=camera_control,
auth_token=auth_token,
)