SkillsGrove
SkillsGrove/영상 제작/genfeedai/skills/media-forge

media-forge

설치

$npx skills add https://github.com/genfeedai/skills --skill media-forge
$git clone --depth 1 https://github.com/genfeedai/skills.git /tmp/skills && mkdir -p ~/.claude/skills && cp -r /tmp/skills/media/media-forge ~/.claude/skills/media-forge
이 Agent Skill을 설치해 주세요: https://github.com/genfeedai/skills/tree/38fcdb2eb770dc7e69c531dcddd2545f9f5771d3/media/media-forge — 먼저 SKILL.md와 스크립트를 읽고, 안전하다고 확인한 뒤에만 제 skills 폴더에 설치해 주세요.

요약

원문 설명 · MITGenerate image, video, and audio artifacts through Replicate or fal.ai and emit downloaded MediaArtifact JSON.
아래 SKILL.md는 genfeedai/skills(커밋 38fcdb2)에서 MIT 라이선스에 따라 게시한 것입니다. 본문은 변경하지 않았으며, 파일 상단의 메타데이터만 생략하고 이미지는 링크로 표시하며 매우 긴 파일은 일부만 표시합니다. Copyright 2026 Genfeed.ai. 라이선스: LICENSE. 지침 파일만 표시되며 스크립트 등은 원본 저장소를 참고하세요.

Media Forge

You turn a prompt into a file. Image, video, or audio — through Replicate or fal.ai, the two aggregators that front nearly every open and commercial generative model. You are the media half of produce in trend -> remix -> produce -> post -> analytic.

Pure worker: no state, no SDK, no persisted secret. You read one token from the environment, submit a job, wait for it, download the outputs, and print MediaArtifact JSON. The orchestrator resolves the token (gf token replicate|fal), runs you, and attaches your artifacts to a ContentItem through the seam.


Run It

bun run scripts/forge.ts \
  --provider replicate|fal \
  --modality image|video|audio \
  --model <model-id> \
  --prompt "..." \
  [--input '{"aspect_ratio":"16:9","num_outputs":2}'] \
  [--out .genfeed/artifacts]

Requires Bun 1.1+. Zero dependencies — only Node built-ins and global fetch.

--input is merged over {prompt} and passed verbatim as the model's input object, so any model-specific parameter is reachable without code changes.


Providers

Replicate

  • Token: REPLICATE_API_TOKEN.
  • Uses the unified POST /v1/predictions endpoint, which accepts owner/name, owner/name:version, or a bare version id as --model.
  • Sends Prefer: wait for synchronous completion, then polls urls.get for anything still running.
bun run scripts/forge.ts --provider replicate --modality image \
  --model black-forest-labs/flux-1.1-pro --prompt "a t-rex on a skateboard, cinematic"

fal.ai

  • Token: FAL_KEY.
  • Uses the async queue: POST https://queue.fal.run/<model>, polls the returned status_url until COMPLETED, then fetches response_url.
bun run scripts/forge.ts --provider fal --modality video \
  --model fal-ai/ltx-video --prompt "neon city flyover at night"

Both providers cap waiting at ~10 minutes (240 polls × 2.5s), enough for slow video jobs.


Output

Outputs are downloaded into --out (default .genfeed/artifacts), one file per result, named art_<uuid>.<ext> (extension inferred from the URL, else png/mp4/mp3 by modality). stdout is:

{
  "count": 1,
  "artifacts": [
    {
      "id": "art_2f1c...",
      "modality": "image",
      "provider": "replicate",
      "model": "black-forest-labs/flux-1.1-pro",
      "prompt": "a t-rex on a skateboard, cinematic",
      "path": ".genfeed/artifacts/art_2f1c....png",
      "meta": { "sourceUrl": "https://...", "index": 0, "createdAt": "..." }
    }
  ]
}

Each artifact matches the MediaArtifact shape in genfeed-connector/lib/schema.ts, so the orchestrator can push it straight onto ContentItem.artifacts[].

Output URLs are extracted by walking the provider's response JSON and collecting every http(s) URL, so it works across model output shapes (string, array, {images:[{url}]}, {video:{url}}, {audio:{url}}, …) without per-model branching.


How It Fits The Loop

# orchestrator resolves the token from the environment through the seam
export REPLICATE_API_TOKEN="$(bun run ../genfeed-connector/gf.ts token replicate)"

# forge a hero image for an item, capture artifacts
ART=$(bun run scripts/forge.ts --provider replicate --modality image \
  --model black-forest-labs/flux-1.1-pro --prompt "$THESIS")

# orchestrator merges $ART.artifacts into the ContentItem and advances the stage

Security

  • Tokens (REPLICATE_API_TOKEN, FAL_KEY) are read from the environment, used in memory, and never written to any file. Resolve them through the connector (gf token replicate|fal), which reads the same env vars.
  • The only outbound calls are to the chosen provider's API and the output-file URLs it returns.
  • Generated files are written only under --out; nothing else touches the filesystem.
라이선스 전문 보기(MIT)
MIT License

Copyright (c) 2026 Genfeed.ai

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.