跳过主要内容
E

dsh-tian-tang-zhi-yan

emma-covus/dsh-tian-tang-zhi-yan

从本地视频抽帧、调生图后端出图,并把小说或剧本编成日式黑白漫画:分镜、台词、网点、成页。

安装

dsh plugin --profile web add github:emma-covus/dsh-tian-tang-zhi-yan

README

Eye of Heaven · 天堂之眼

Watch images and videos, generate art, and turn a novel or script into a Japanese black-and-white manga — storyboard, lettering, screentone and finished pages in one pass.

看图、看视频、出图,并把小说或剧本编成日式黑白漫画:分镜、台词、网点、成页一次做完。

A plugin for DeepSeek Harness (dsh). It registers nine model-facing tools plus a Python renderer that lays out real manga pages.

中文说明见下方 · Install · Tools · Configuration · Requirements · Limitations


Install

# from npm
dsh plugin --profile <profile> add dsh-tian-tang-zhi-yan

# from GitHub source (pnpm may ask to approve build scripts)
dsh plugin --profile <profile> add github:Emma-covus/dsh-tian-tang-zhi-yan

In the Desktop app, use Settings → Plugins → Add plugin and pick the package name, then restart the harness.

Tools

ToolInputOutput
eye_status—Self-check: Python, ffmpeg, image backend, storyboard model, output directory
eye_watchA local video file2–24 frames sampled across the timeline, stitched into one timestamped contact sheet
eye_drawA prompt, optionally a reference imageOne PNG (black-and-white manga ink by default), shown in the conversation
eye_scriptA novel or script passageStoryboard JSON — can render straight to pages with render: true
eye_pageStoryboard JSONManga page PNGs; mode: "name" produces a name draft plus a top-down camera map
eye_sketchStoryboard JSON, selected pages/panelsPanel sketches from ComfyUI, flattened to white-background line art, written back to panel.art
eye_nameStoryboard JSONA Markdown storyboard script: staging, blocking, axis, then per-panel direction. Writes a file, does not render
storyboard_checkStoryboard JSONRead-only review against the loaded principles card and machine rules
eye_setupConfig fieldsPersists the plugin's configuration and restarts so the next call uses it

Typical use:

Watch a video:  eye_watch({ path: "D:\\video\\ep01.mp4", frames: 10 })
Draw an image:  eye_draw({ prompt: "rainy rooftop at night, short-haired girl from behind, neon reflections", size: "832x1216" })
Make a manga:   eye_script({ text: "...novel passage...", pages: 4, render: true })
Revise pages:   eye_page({ path: ".../storyboard.json", pages: [2, 3], dpi: 300 })

eye_script decides panel layout, shot size, camera position and dialogue using Japanese manga grammar; reading order is right-to-left, top-to-bottom. The storyboard JSON lands in tian-tang-out/script/ under the workspace, so you can edit it by hand and render again.

Character appearance is written once under characters; cast carries only position, action and expression. Each panel's image prompt is assembled from world + character + shot + composition, and only the focus character is allowed a full face — the rest are back views, profiles or silhouettes, which keeps small models such as SD1.5 from blending several faces into one.

Configuration

Set these on the plugin row (config) or through eye_setup:

imageBackend: mock      # mock | openai | gemini | comfyui | sdwebui
imageBaseURL: ''
imageModel: ''
imageSize: 1024x1024
pageSize: B6            # B6 | B5 | A5 | A4 | A6 | square
dpi: 200
llmProvider: deepseek-account
llmModel: deepseek-flash
outDir: ''              # default: <workspace>/tian-tang-out
pythonPath: ''
ffmpegPath: ''
boardCard: ''           # custom principles card (.md); empty = built-in board/principles.md
boardCardChars: 9000
boardCheck: true        # run the machine review after generating
# ComfyUI split-model files (used when present; otherwise comfyCheckpoint)
comfyUnet: ''
comfyClip: ''
comfyClipType: krea2
comfyVae: ''
comfyLora: ''
comfyLoraStrength: 1
comfyScheduler: simple

Secrets are read from the environment only: EYE_IMAGE_API_KEY. These environment variables override the row: EYE_IMAGE_BACKEND, EYE_IMAGE_BASE_URL, EYE_IMAGE_MODEL, EYE_PYTHON, EYE_FFMPEG, EYE_OUT_DIR, EYE_LLM_PROVIDER, EYE_LLM_MODEL, EYE_BOARD_CARD.

mock is the default backend: it draws programmatic placeholder art (screentone, silhouettes, speed lines, rain) so the whole storyboard → art → page pipeline runs offline. It is a layout stand-in, not generated illustration — point imageBackend at a real backend to draw actual art. A failing backend falls back to mock and says why, instead of breaking the pipeline.

Requirements

  • DeepSeek Harness 0.2.x, Node.js 20+
  • Python with Pillow and numpy for page rendering and contact sheets. The DSH desktop build bundles a runtime the plugin finds automatically; otherwise set pythonPath / EYE_PYTHON.
  • ffmpeg only for eye_watch (frame sampling). Looked up in ~/.dsh/tools/ffmpeg/bin/, then on PATH; override with ffmpegPath / EYE_FFMPEG.
  • An image backend of your choice for real art (any OpenAI-compatible /v1/images/generations, Gemini, local ComfyUI, or local Stable Diffusion WebUI).

Limitations

  • eye_watch reads local video files only; live screen or camera capture belongs to a separate plugin.
  • Page rendering needs Python + Pillow + numpy; without them only the JSON and Markdown outputs are available.
  • mock art carries no semantics: it expresses composition and tone, not the content of the prompt.
  • 3–5 panels per page and 1–2 pages per call are the stable range; longer runs tend to drift on character consistency.
  • Multi-character panels are unstable on SD1.5-class checkpoints, which is why only the focus character gets a full face by default.
  • Gray, painterly checkpoints (such as Counterfeit) do not produce true ink-on-screentone manga; use a manga-oriented checkpoint or LoRA, or an image-to-image backend, for harder lines.

Docs

  • docs/DETAIL.md — full tour of the tools, backends and rendering
  • docs/STORYBOARD.md — the storyboard JSON format (staged blocking, generated prompts, balloon placement)
  • docs/BOARD.md — the principles card, machine rules and the post-generation review
  • board/principles.md — the storyboard principles injected into every script call

中文

DSH 插件:看图、看视频、出图,并把小说或剧本编成日式黑白漫画——分镜、台词、网点、成页一次做完。

  • 宿主侧:index.js + lib/(工具注册、LLM 分镜、生图后端、ffmpeg 抽帧、Python 桥)
  • 分镜原则:board/principles.md(原则卡)+ board/rules.json(机器红线)+ lib/board.js(注入与自检)
  • 渲染器:python/render_page.py(成页)、render_art.py(单格)、contact_sheet.py(联系表)

安装:

dsh plugin --profile <profile> add dsh-tian-tang-zhi-yan

或在 DSH 的 插件 页面用「添加插件」选择本目录。

默认 imageBackend: mock:不联网,用程序化画面(网点、剪影、集中线、雨)画出ネーム / 分镜稿级别的示意画面。要真画,在插件行 config 里改 imageBackend;密钥只从环境变量读 EYE_IMAGE_API_KEY。

从分镜到成页:eye_script 只写分镜,不批量出图;批量出图用你自己的脚本调用 lib/imagegen.js 的 generateImage,按 panel.artPrompt / panel.negative 出图并写回 panel.art,再交给 eye_page 渲染。

License

MIT

相关插件