Skip to content

feat(muse2api): send entity reference images with scene images - #77

Merged
crisng95 merged 1 commit into
mainfrom
feat/muse2api-refs
Oct 25, 2026
Merged

crisng95 merged 1 commit into
mainfrom
feat/muse2api-refs

Conversation

@crisng95

Copy link
Copy Markdown
Owner

The muse2api provider dropped every reference image on the assumption that the gateway took none. It does: /v1/images/generations accepts image as a data URL or a list of them, and the browser driver attaches them to the muse.ai chat. Scenes rendered through muse2api therefore lost their characters.

  • Muse2APIClient.generate_image takes images and sends them as image, capped at MAX_IMAGE_REFS (4).
  • The provider dedupes the job's refs, keeps the first four (logging the rest) and inlines them as data URLs.
  • An unreadable or unreachable ref now fails the job instead of rendering the scene without its character. httpx errors on input fetch are caught like OSError/ValueError, which also covers a video's start frame.
  • README and /fk-provider describe the new behaviour, plus a billing note for gateways with wallets enabled.

Test plan:

  • pytest -q tests green; new tests cover refs → data-URL list, no image field without refs, dedupe + cap at 4, unreadable ref fails the job, unreachable http ref fails the job
  • Live end-to-end through a muse2api gateway: character ref image → scene image with that ref (character consistent) → 8s video, all COMPLETED

🤖 Generated with Claude Code

The provider dropped every reference image on the assumption that the
gateway took none. It does: /v1/images/generations accepts `image` as a
data URL or a list of them, and the browser driver attaches them to the
muse.ai chat. Scenes rendered through muse2api therefore lost their
characters.

- Muse2APIClient.generate_image takes `images` and sends them as `image`,
  capped at MAX_IMAGE_REFS (4).
- The provider dedupes the job's refs, keeps the first four (logging the
  rest) and inlines them as data URLs.
- An unreadable or unreachable ref now fails the job instead of rendering
  the scene without its character; httpx errors on input fetch are caught
  like OSError/ValueError (this also covers a video's start frame).
- README and /fk-provider describe the new behaviour and the billing note
  for gateways with wallets enabled.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@crisng95
crisng95 merged commit 6844a88 into main Oct 25, 2026
2 checks 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.

1 participant