Skip to content

Add plugin octopus-meme-maker - #40

Merged
hetaoBackend merged 1 commit into
MiniMax-AI:mainfrom
weekbin:add-octopus-meme-maker
Sep 15, 2026
Merged

hetaoBackend merged 1 commit into
MiniMax-AI:mainfrom
weekbin:add-octopus-meme-maker

Conversation

@weekbin

@weekbin weekbin commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

What changes

Adds plugins/weekbin/octopus-meme-maker — a Skill-only Plugin that turns a scene description into a Smooth Squishmallow-style pink-octopus office-worker GIF meme (720x720 looping + 480x480 mini).

Ships the portable Agent Plugins 1.0 manifest that the hosted validator checks, plus the mcode 0.4.0+ Claude Code compatible manifest (.claude-plugin/plugin.json) that docs/plugin-compatibility.md now recommends shipping in parallel for a cross-runtime Plugin. .minimax-plugin/plugin.json is the Marketplace submission manifest; README documents which reader takes each.

Stage 1 is a mandatory 6-candidate contact-sheet loop: one image_synthesize call with 6 parallel requests, a numbered contact sheet (1460x974), hand it to the user, then stop. Stage 2 must not start until the user picks. Four Python scripts assemble the GIFs; _fonts.py and _platform.py hold the shared CJK-font and cross-platform helpers.

User value

A MiniMax Code user can produce a new meme in the existing 烤焦了-style library without touching ffmpeg. The character stays consistent because the prompt is anchored to bundled base-pose references plus a ban-list, and the user picks from 6 candidates instead of accepting a single render.

Example prompt:

给我做一个新的章鱼打工人表情包:摆烂躺平(趴在桌上,一只眼睛半闭,另一只全闭,一条触手尖端着一杯咖啡)。
角色必须和 examples/*.png 里的参考底图一致。
结果存到 <scene-dir>/,按 skills/octopus-meme-maker/SKILL.md 里的流程执行(6 候选拼图 → 用户挑选 → base.png)。

Expected result: <scene-dir>/base.png (1024×1024) → <scene-dir>/video.mp4 (1080×1080, 141 frames @ 24fps) → <scene-dir>/final.gif (720×720, 141 frames) + <scene-dir>/final-mini.gif (480×480, 141 frames).

Plugin submission checklist

  • Plugin lives at plugins/<github-owner>/<plugin-name>.
  • plugin.json name matches the Plugin directory.
  • README.md includes a real example prompt and expected result.
  • LICENSE and plugin.json declare an open-source license.
  • Required executables, accounts, paid services, and supported platforms are disclosed.
  • Network destinations and data handled by the plugin are disclosed.
  • No credentials, private endpoints, hidden telemetry, installers, symlinks, or native binaries are included.
  • Every scaffold TODO has been replaced.
  • npm run check passes.

Evidence

$ node scripts/validate.mjs
OK   plugin weekbin/octopus-meme-maker
Validated 26 hosted Plugins and all examples.

$ node --test tests/plugins/octopus-meme-maker/smoke.test.mjs
# tests 65
# pass 65
# fail 0

Host-tool calls in the docs were checked against the shipped @minimax-ai/code schemas (mcode 0.4.6) rather than assumed. gen_videos takes prompt, output_file_path (required), input_image_path, reference_type, duration (6|10) and resolution (768P|1080P) — there is no fps and no size parameter, and generation is asynchronous. image_synthesize accepts up to 10 requests with at most 4 reference images. Paths outside the session workspace are rejected, temp directories included.

Manual test — the README self-test runs end to end against the bundled sample video on both platforms, with identical artifact geometry:

Artifact macOS 13+ (Py 3.14.7 / Pillow 12.3.0 / ffmpeg 8.1.2) Ubuntu 24.04.4 (Py 3.12.3 / Pillow 10.2.0 / ffmpeg 6.1.1)
overlay 1080×220 RGBA 1080×220 RGBA
preview 2400×530 RGB 2400×530 RGB
contact sheet 1460×974 RGB 1460×974 RGB
final.gif 720,720,141 720,720,141
final-mini.gif 480,480,141 480,480,141
14-char caption auto-fit size 88 size 88

Cross-platform notes: no shell invocation (subprocess.run with argv lists only), no locale-dependent subprocess decoding, os.path.join throughout, Windows reserved output names rejected (CON/NUL/AUX/…), and a console-encoding fallback so a CJK caption cannot raise UnicodeEncodeError on a cp1252 or cp936 console. Windows itself is untested — no host available — and the README says so rather than claiming it.

Local npm run check caveat: validate and this Plugin's 65 tests pass locally. The full node --test run does not complete on my machine because two tests in the pre-existing plugins/Hylouis233/cli-agent-bridge time out — unrelated to this PR, and reproducible on plain upstream/main without my changes.

Plugin-local smoke.test.mjs is included at tests/plugins/octopus-meme-maker/ and skips its interpreter-dependent cases when python3 or Pillow is unavailable, so it stays green on the CI runner.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@hetaoBackend

Copy link
Copy Markdown
Collaborator

发现一个边界条件问题:make_preview_strip.py--workdir 指向一个已存在的普通文件时,会在 os.makedirs(..., exist_ok=True) 处抛出未捕获的 FileExistsError,向用户暴露 Python traceback。\n\n建议在创建目录前显式检查 os.path.isdir(workdir),输出清晰的参数错误,并补充一个 --workdir 指向普通文件的回归测试。

@hetaoBackend

Copy link
Copy Markdown
Collaborator

两个核心参考资产的扩展名与真实格式不一致:examples/10-toilet-slacking-base.pngexamples/11-touch-fish-base.png 实际是 JPEG,但 Skill 文档要求将它们作为 image_synthesizeinput_file_paths 传入。宿主如果按扩展名推断 MIME 或校验扩展名,可能拒绝这些输入。\n\n建议将文件真正转码为 PNG,或统一重命名为 .jpg 并同步更新 SKILL.md、reference.md、README、examples/README.md 及 smoke test;同时让测试校验实际文件格式与扩展名一致。

weekbin added a commit to weekbin/MiniMax-Code-Plugins that referenced this pull request Sep 15, 2026
- examples/10-toilet-slacking-base.png and examples/11-touch-fish-base.png were
  JPEGs under a .png extension; the docs ask the agent to pass them as
  image_synthesize input_file_paths, so the host may sniff by extension and
  refuse. Re-encode both to real PNGs (same paths, no doc churn).

- make_preview_strip.py: when --workdir points at an existing regular file,
  os.makedirs(..., exist_ok=True) used to leak an uncaught FileExistsError
  traceback. Reject that case in argument validation with a clear message.

- smoke.test.mjs: add two regressions — PNG signature check on the three
  examples/, and a subprocess invocation that drives the workdir regression
  through spawnSync.
@weekbin
weekbin force-pushed the add-octopus-meme-maker branch from a4263b6 to e693aa2 Compare September 15, 2026 09:10
A Plugin for MiniMax Code that turns a one-line scene description into a
Smooth Squishmallow-style pink octopus office-worker GIF meme. The
package ships the four-stage pipeline (base pose -> 6s video ->
transparent Chinese caption -> 720x720 GIF), the four cross-platform
Python scripts that assemble it, the reference image library that
locks character / style across scenes, and a smoke self-audit plus
negative-injection regression test.

examples/ carries three 1024x1024 base.png references that the host
image_synthesize reads as input_file_paths; the host can sniff MIME
from the extension, so the file content and suffix are kept in sync
(verified by smoke.test.mjs PNG signature check). The reference
images are downscaled from 2048x2048 to 1024x1024 because the GitHub
PR diff viewscreen rejects large binary previews, and 1024x1024 is
the native training resolution of the underlying diffusion model so
no character fidelity is lost.

scripts/make_preview_strip.py refuses --workdir when it resolves to
an existing regular file instead of a directory, so the caller gets
a clear argument error rather than a leaked FileExistsError
traceback. The behaviour is locked in by a regression test.

All script argv is plumbed via subprocess.run argument lists (no
shell, no injection surface); CJK font discovery is centralized in
scripts/_fonts.py and shared by all four scripts; console encoding
is forced UTF-8 with errors='replace' so a caller with cp1252 stdout
still gets the success line.

PR-40 review-driven changes:
- examples/10-, examples/11- were JPEGs with .png extensions; re-
  encoded as real PNG (smoke test enforces the signature).
- make_preview_strip.py gained a non-directory --workdir guard.
@weekbin
weekbin force-pushed the add-octopus-meme-maker branch from e693aa2 to cf8291e Compare September 15, 2026 09:15
@hetaoBackend
hetaoBackend merged commit d592f42 into MiniMax-AI:main Sep 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants