@surfmate.team/digital-human-runninghub
v0.4.0
Published
RunningHub (ComfyUI-as-a-service) adapter. A generic, workflow-agnostic client (upload / run AI app / watch task) plus a greeting-video binding that implements greeting's GreetingVideoPort by composing the client with an injected TTS VoiceSynthesisPort. T
Readme
@surfmate.team/digital-human-runninghub
RunningHub (ComfyUI-as-a-service) adapter. A generic, workflow-agnostic client (upload / run AI app / watch task) plus per-workflow bindings. The client is reusable for ANY RunningHub AI App; each binding pins one published app's id + node mappings and exposes a small typed port.
npm i @surfmate.team/digital-human-runninghubPart of the @surfmate.team digital-human suite (ports/DI — the package owns its data + logic; the app injects the client { apiKey } + any TTS backend).
AI App bindings
| Binding | App ID | Inputs | Output | Factory | 说明 |
| --- | --- | --- | --- | --- | --- |
| greeting — talking greeting video (Wan2.1 I2V 720p, audio-synced) | 2048355544552968194 | avatar image + TTS speech + action prompt | 1 MP4 (audio baked in) | createRunningHubGreetingVideo | |
| waiting — static waiting loop (Infinite Talk, silence-driven) | 2050552043860963330 | avatar image + prompt + N s silence | looping MP4 | createRunningHubStaticWaitingVideo | |
| dialogue — 多人对话, two-person lip-sync (InfiniteTalk dual-image) | 2062039217370394626 | 1 image (two people) + 3 aligned audio tracks (left / right / full) | 1 MP4 (each person to their own voice) | createRunningHubDialogueVideo | |
| text2image / qwen2512 — 文生图 (Qwen-Image 2512) | 2052988750950617090 | prompt + width/height + batch size | image URL(s) | createRunningHubQwen2512 | |
| text2image / flux2klein — 文生图 (Flux2 Klein) | 2026466502756536322 | prompt + width/height + batch size | image URL(s) | createRunningHubFlux2Klein | |
| imageedit / qwen2511 — 图像编辑 (Qwen-Image 2511) | 2025738520135995394 | 1 required image + up to 2 optional + prompt | image URL(s) | createRunningHubQwen2511 | |
All bindings take { client }, report progress via an onProgress callback (上传素材中… → 提交任务中… → 排队中… → 生成中… N%), and resolve to RunningHub CDN URLs (~24h expiry — persist/mirror anything long-lived).
import { createRunningHubClient, createRunningHubTextToImage } from '@surfmate.team/digital-human-runninghub'
const client = createRunningHubClient({ apiKey: RUNNINGHUB_API_KEY }) // key stays out of the front end
const text2image = createRunningHubTextToImage({ client })
const [url] = await text2image.generate(
{ prompt: '长沙夜色…', width: 1920, height: 1080 },
(p) => console.log(p.message),
)The generic createRunningHubClient (upload / runApp / pollTask / watchTask) is exported too — wire any other RunningHub app with it directly.
Workflow backups
Exported ComfyUI graphs for the bindings live next to the code; see docs/workflows.md for the binding → App ID → JSON mapping.
License
MIT
