Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/api/src/opendirector_api/localization.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
'prompt_optimization_result': 'The model did not return a usable prompt. Your original text was kept.',
'prompt_optimization_provider': 'The text model could not optimize the prompt. Check its settings and try again. Your original text was kept.',
'image_quality_unsupported': 'This model does not support the selected image quality. Choose Auto or select another model.',
'higgsfield_model': 'Choose a supported Higgsfield Open model and the official API URL.',
'higgsfield_image': 'Use valid PNG or JPEG references within the image count and size limits.',
'higgsfield_frames': 'Use first/last frame mode with one image per slot. A last frame requires a first frame.',
'higgsfield_prompt': 'Enter a prompt of up to 50,000 characters.',
'bigmodel_video_model': 'The BigModel video protocol supports CogVideoX-3 only.',
'bigmodel_video_output': 'Choose a supported CogVideoX-3 pixel size and a 5- or 10-second duration. The size determines the aspect ratio.',
'bigmodel_video_image': 'CogVideoX-3 frame images must be valid PNG or JPEG files, up to 5 MB each.',
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/opendirector_api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AssetSource(Model):

class ModelConnection(Model):
connectionType: Literal['api', 'self_hosted'] = 'api'
protocol: Literal['openai', 'volcengine', 'bigmodel_video', 'kling_video', 'minimax_video_v2', 'vllm_omni', 'vllm_omni_segmentation', 'vllm_omni_music', 'vllm_omni_depth', 'vllm_omni_score'] | None = None
protocol: Literal['openai', 'volcengine', 'higgsfield_open', 'bigmodel_video', 'kling_video', 'minimax_video_v2', 'vllm_omni', 'vllm_omni_segmentation', 'vllm_omni_music', 'vllm_omni_depth', 'vllm_omni_score'] | None = None
authMode: Literal['none', 'bearer'] | None = None
proxyMode: Literal['system', 'direct'] | None = None
capabilityAutoCheck: bool | None = Field(default=None, strict=True, exclude_if=lambda value: value is None)
Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ This directory is the entry point for the repository's shared documentation. The
| [Model availability / 模型可用状态](guides/model-availability.md) | Optional runtime declarations, automatic checks, shared admission and API/CLI/Agent queries | Capability protocol, refresh, or acceptance rules change |
| [OpenAI Images](guides/openai-images.md) | Wiring gpt-image as an optional image service, request shape and failures | Integration fields, capability scope, or the OpenAI interface change |
| [Kling video](guides/kling-video.md) ([中文](guides/kling-video.zh-CN.md)) | Optional Kling 4.0 and Flash setup, model-specific inputs, and recovery limits | Kling inputs, model declarations, or recovery behavior change |
| [Higgsfield Open](guides/higgsfield-open.md) ([中文](guides/higgsfield-open.zh-CN.md)) | Image and video presets, reference uploads and task recovery | Higgsfield Open integration changes |
| [BigModel video](guides/bigmodel-video.md) ([中文](guides/bigmodel-video.zh-CN.md)) | CogVideoX-3 text, single-image and first/last-frame generation, task recovery and adoption | BigModel protocol, inputs, output sizes or recovery behavior change |
| [BigModel GLM-Image](guides/bigmodel-image.md) ([中文](guides/bigmodel-image.zh-CN.md)) | Account setup, text-to-image generation, adoption and recovery | BigModel integration fields or behavior change |
| [GLM-Image validation](development/glm-image-validation.md) | Real provider workflow screenshots and automated checks | GLM-Image acceptance is repeated |
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions docs/guides/higgsfield-open.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Higgsfield Open

In **Settings → Models**, choose **Higgsfield Open** for an image or video model. Paste the complete key (`KEY_ID:KEY_SECRET`) from [Higgsfield Open](https://open.higgsfield.ai/api-keys). The provider uses `https://api.higgsfield.ai`.

- **Kling Image 4.0** generates 2K images from a prompt or edits up to four reference images. Edit references must be PNG or JPEG, at least 300 pixels on each side, with an aspect ratio between 2:5 and 5:2.
- **Kling 4.0** generates 720p or 1080p videos of 3–30 seconds. Use a prompt, a first-frame image, or an explicit first/last pair. For frame-based generation, leave the aspect ratio on Auto to follow the supplied image.

OpenDirector accepts PNG or JPEG references up to 10 MB each for this provider. It uploads references using Higgsfield's signed upload flow. Image mentions in the prompt follow the upload order.

After submission, OpenDirector stores the remote request ID. Resuming an accepted task polls that ID. Remote cancellation is available while the request is queued. See the [Higgsfield Open quick start](https://open.higgsfield.ai/quick-start).
10 changes: 10 additions & 0 deletions docs/guides/higgsfield-open.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Higgsfield Open

在「设置 → 模型」中为图片或视频选择 **Higgsfield Open**,粘贴从 [Higgsfield Open](https://open.higgsfield.ai/api-keys) 复制的完整密钥(`KEY_ID:KEY_SECRET`)。接口地址为 `https://api.higgsfield.ai`。

- **Kling Image 4.0** 支持 2K 文生图和参考图编辑,最多可使用四张参考图。编辑参考图须为 PNG 或 JPEG,宽高均至少为 300 像素,宽高比介于 2:5 和 5:2 之间。
- **Kling 4.0** 支持生成 3–30 秒的 720p 或 1080p 视频。可以使用提示词、首帧图片,或明确指定首尾帧。使用图片帧时,将画幅设为自动以沿用图片画幅。

OpenDirector 为该服务接受单张不超过 10 MB 的 PNG 或 JPEG 参考图,并通过 Higgsfield 的签名上传流程传输。提示词中的图片引用编号对应上传顺序。

提交后,OpenDirector 保存远端请求 ID。恢复已受理的任务时会用该 ID 继续查询。任务在远端排队时可请求取消。参见 [Higgsfield Open 快速开始](https://open.higgsfield.ai/quick-start)。
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,18 @@ def _parameters(self, spec, config, node, records):
if spec.kind == 'video' and config['protocol'] == 'kling_video':
from opendirector.domain.kling_models import kling_parameters
return kling_parameters(config, intent, any(records[key]['kind'] == 'image' for key in node['referenceIds']))
if config['protocol'] == 'higgsfield_open':
if spec.kind == 'image':
from opendirector.domain.image_output import resolve_image_output
ratio = intent.get('aspectRatio') or 'auto'
return {'size': resolve_image_output(config, input_rules(config), {**intent, 'aspectRatio': ratio}),
'aspect_ratio': ratio}
from opendirector.domain.kling_models import kling_parameters
has_frames = any(records[key]['kind'] == 'image' for key in node['referenceIds'])
rules = input_rules(config)
output = kling_parameters({**config, 'modelId': 'kling-4.0',
'videoCapabilities': rules['videoCapabilities']}, intent, has_frames)
return {key: output[key] for key in ('resolution', 'duration', 'ratio')}
if spec.kind == 'text':
params.update(thinking=intent['thinking'], max_tokens=intent['maxTokens'])
if spec.kind == 'image':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ def command_fingerprint(command: Command) -> str:
from opendirector.domain.timeline_errors import TimelineIssueCode

IssueCode = Literal[TimelineIssueCode, 'invalid_input', 'revision_conflict', 'role_restricted', 'canvas_run_layout_group', 'canvas_run_layout_conflict', 'canvas_run_layout_extent', 'canvas_run_layout_shared_object', 'missing_object', 'reference_invalid', 'image_quality_unsupported',
'higgsfield_model', 'higgsfield_image', 'higgsfield_frames', 'higgsfield_prompt',
'bigmodel_video_model', 'bigmodel_video_output', 'bigmodel_video_image',
'bigmodel_video_frames', 'bigmodel_video_prompt', 'bigmodel_video_cancel',
'kling_model', 'kling_mode', 'kling_image', 'kling_frames', 'kling_prompt', 'kling_aspect', 'kling_output', 'kling_cancel',
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/opendirector/domain/creation/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from .base import Contract

ModelKind = Literal['agent', 'image', 'video', 'audio', 'vision']
Protocol = Literal['openai', 'volcengine', 'bigmodel_video', 'kling_video', 'minimax_video_v2', 'vllm_omni', 'vllm_omni_segmentation', 'vllm_omni_music', 'vllm_omni_depth', 'vllm_omni_score']
Protocol = Literal['openai', 'volcengine', 'higgsfield_open', 'bigmodel_video', 'kling_video', 'minimax_video_v2', 'vllm_omni', 'vllm_omni_segmentation', 'vllm_omni_music', 'vllm_omni_depth', 'vllm_omni_score']
VideoMode = Literal['first_frame', 'reference', 'continuation', 'control']
ImageQuality = Literal['auto', 'low', 'medium', 'high']
Count = Annotated[int, Field(strict=True, ge=0)]
Expand Down Expand Up @@ -135,8 +135,8 @@ def model_name(cls, value):

@model_validator(mode='after')
def connection(self):
allowed = {'agent': {'openai'}, 'image': {'openai', 'volcengine', 'vllm_omni_segmentation'},
'video': {'bigmodel_video', 'kling_video', 'minimax_video_v2', 'vllm_omni', 'volcengine', 'vllm_omni_segmentation', 'vllm_omni_depth'},
allowed = {'agent': {'openai'}, 'image': {'higgsfield_open', 'openai', 'volcengine', 'vllm_omni_segmentation'},
'video': {'higgsfield_open', 'bigmodel_video', 'kling_video', 'minimax_video_v2', 'vllm_omni', 'volcengine', 'vllm_omni_segmentation', 'vllm_omni_depth'},
'audio': {'openai', 'volcengine', 'vllm_omni_music', 'vllm_omni_score'}, 'vision': {'vllm_omni'}}
if self.protocol not in allowed[self.kind]:
raise ValueError('Protocol is incompatible with model category')
Expand Down
17 changes: 17 additions & 0 deletions packages/core/src/opendirector/domain/higgsfield.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""Supported Higgsfield Open model families and reference limits."""

from .projects import ProjectError

BASE = 'https://api.higgsfield.ai'
IMAGE_MODEL = 'kling-image/v4.0'
VIDEO_MODEL = 'kling-video/v4.0'
IMAGE_RATIOS = ('auto', '1:1', '16:9', '9:16', '4:3', '3:4', '3:2', '2:3', '21:9')
IMAGE_BYTES = 10 * 1024 * 1024


def validate_model(config):
models = {'image': IMAGE_MODEL, 'video': VIDEO_MODEL}
if (config['url'].rstrip('/') != BASE or config.get('authMode', 'bearer') != 'bearer'
or config.get('connectionType', 'api') != 'api'
or models.get(config['kind']) != config['modelId']):
raise ProjectError('请选择 Higgsfield Open 支持的模型和官方 API 地址。', 422, code='higgsfield_model')
3 changes: 3 additions & 0 deletions packages/core/src/opendirector/domain/image_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@


def image_outputs(config, profile):
if profile == 'higgsfield-open':
from .higgsfield import IMAGE_RATIOS
return [dict(aspectRatio=ratio, size='2K') for ratio in IMAGE_RATIOS]
if profile == 'bigmodel-glm-image':
return [dict(aspectRatio=ratio, size=size) for ratio, size in BIGMODEL_IMAGE_OUTPUTS]
if profile == 'minimax-h3-image':
Expand Down
8 changes: 8 additions & 0 deletions packages/core/src/opendirector/domain/input_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from .moss_speech import is_moss_speech
from .minimax_speech import MINIMAX_SPEECH_MODELS, MINIMAX_SPEECH_TEXT_CHARACTERS, is_minimax_speech
from .projects import ProjectError
from .higgsfield import IMAGE_BYTES, validate_model
from .kling_models import KLING_MODELS, KLING_RATIOS, kling_capabilities
from .bigmodel_image import is_bigmodel_image
from .zhipu_speech import ZHIPU_DEFAULT_VOICE, ZHIPU_SPEECH_CHARACTERS, is_zhipu_speech
Expand All @@ -22,6 +23,13 @@ def _adapter_rules(config):
'maxAudios': 0, 'imageBytes': 8 * 1024 * 1024, 'requestBytes': 48 * 1024 * 1024,
'videoModes': ['first_frame'] if kind == 'video' else []}
rules.update(maxVideos=0, videoBytes=DEFAULT_VIDEO_BYTES)
if config.get('protocol') == 'higgsfield_open':
validate_model(config)
rules.update(profile='higgsfield-open', maxImages=4 if kind == 'image' else 2, imageBytes=IMAGE_BYTES,
maxPromptCharacters=50000)
if kind == 'video':
rules.update(frameRoles=['first_frame', 'last_frame'], aspectRatios=list(KLING_RATIOS))
return rules
if is_bigmodel_image(config):
rules.update(profile='bigmodel-glm-image', allowedKinds=['text'], maxImages=0)
return rules
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/opendirector/domain/model_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ def connection_fields(kind, connection_type='api', protocol=None, auth_mode=None
raise ProjectError('无效的接入方式。')
protocol = protocol or ('openai' if kind == 'agent' or connection_type == 'self_hosted' and kind not in {'video', 'vision'}
else 'vllm_omni' if connection_type == 'self_hosted' else 'volcengine')
allowed = {'agent': {'openai'}, 'image': {'openai', 'volcengine', 'vllm_omni_segmentation'},
'video': {'bigmodel_video', 'kling_video', 'minimax_video_v2', 'vllm_omni', 'volcengine', 'vllm_omni_segmentation', 'vllm_omni_depth'},
allowed = {'agent': {'openai'}, 'image': {'higgsfield_open', 'openai', 'volcengine', 'vllm_omni_segmentation'},
'video': {'higgsfield_open', 'bigmodel_video', 'kling_video', 'minimax_video_v2', 'vllm_omni', 'volcengine', 'vllm_omni_segmentation', 'vllm_omni_depth'},
'audio': {'openai', 'volcengine', 'vllm_omni_music', 'vllm_omni_score'}, 'vision': {'vllm_omni'}}
auth_mode = auth_mode or ('none' if connection_type == 'self_hosted' else 'bearer')
proxy_mode = proxy_mode if proxy_mode is not None else 'system'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def seedance_20_variant(model):
def preset_capabilities(profile, model=''):
if profile == 'bigmodel-cogvideox-3':
return cogvideo_capabilities(model)
if profile == 'higgsfield-open':
return {**kling_capabilities('kling-4.0'), 'defaultDuration': 10}
if profile == 'kling-official':
return kling_capabilities(model)
if profile in {'fasth3-omni', 'vllm-omni-h3'}:
Expand Down Expand Up @@ -132,7 +134,7 @@ def check_video_config(kind, protocol, adapter, capabilities):
if protocol == 'bigmodel_video':
validate_cogvideo_outputs(capabilities)
return capabilities
if protocol == 'kling_video':
if protocol in {'kling_video', 'higgsfield_open'}:
validate_kling_outputs(capabilities)
return capabilities
if protocol == 'minimax_video_v2':
Expand Down
Loading
Loading