Skip to content

ImageSDK lacks image download/save capability #144

@NianJiuZst

Description

@NianJiuZst

Summary

ImageSDK.generate() returns an ImageResponse with image URLs or base64 data, but provides no method to download or save those images to disk. Users must manually implement URL downloads with retries, base64 decoding, directory creation, and file-naming logic.

The CLI already does all of this via --out, --out-dir, and --out-prefix flags in mmx image generate.

Proposed solution

Add a save(response, options?) method to ImageSDK that:

  • Downloads images from CDN URLs (with retry/backoff via the existing downloadFile() utility)
  • Decodes base64 images from the response
  • Supports single-file exact path (out) and multi-file directory output (outDir + prefix)
  • Creates intermediate directories as needed

See linked PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions