feat: 新增首尾帧 K3 自研节点、代理参数重命名、Gemini 客户端优化
- 新增 K3VideoFirstLast 节点(首尾帧 K3 自研):基于 K3Video 去掉分镜,新增可选尾帧输入,尾帧通过 metadata.image_tail 传递 - nano_banana_pro / batch_nano_banana_pro:将参数「代理加速」重命名为「代理端口(如7897)」 - gemini_client:新增 build_proxy_url、_estimate_body_size、_scale_images_to_fit 工具方法 - base_client:小幅优化
This commit is contained in:
@@ -214,6 +214,12 @@ class BatchNanoBananaPro:
|
||||
optional_inputs["图片配对模式"] = (cls.PAIRING_MODES, {
|
||||
"default": "不配对"
|
||||
})
|
||||
|
||||
optional_inputs["代理加速"] = ("STRING", {
|
||||
"default": "",
|
||||
"multiline": False,
|
||||
"placeholder": "本地代理端口,如 7897(Clash Verge)或 10808(v2rayN),留空不使用"
|
||||
})
|
||||
|
||||
return {
|
||||
"required": {
|
||||
@@ -742,6 +748,7 @@ class BatchNanoBananaPro:
|
||||
# 从 kwargs 提取搜索参数(界面显示为「关闭/打开」,转为 bool 供调用)
|
||||
enable_grounding: bool = (kwargs.pop("谷歌搜索(联网)", "关闭") == "打开")
|
||||
enable_image_search: bool = (kwargs.pop("图片搜索(联网)", "关闭") == "打开")
|
||||
proxy_port: str = kwargs.pop("代理加速", "")
|
||||
|
||||
|
||||
try:
|
||||
@@ -881,6 +888,11 @@ class BatchNanoBananaPro:
|
||||
self.client = GeminiAPIClient()
|
||||
except ValueError as e:
|
||||
raise ValueError(f"初始化 API 客户端失败: {str(e)}")
|
||||
|
||||
# 注入代理设置(每次执行都刷新,支持用户中途修改端口)
|
||||
self.client.proxy_url = GeminiAPIClient.build_proxy_url(proxy_port)
|
||||
if self.client.proxy_url:
|
||||
print(f"BatchNanoBananaPro: 已启用代理加速 → {self.client.proxy_url}")
|
||||
|
||||
# 判断是否使用默认 output 目录
|
||||
original_save_path = kwargs.get('保存路径', '')
|
||||
|
||||
Reference in New Issue
Block a user