gemini-to-seedream-migration_skill

This skill aids migrating image generation from Gemini to BytePlus SeeDream v4.5, improving quality, resolution, and cost efficiency.
  • Python

135

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill julianromli/ai-skills --skill gemini-to-seedream-migration

  • SKILL.md11.7 KB

Overview

This skill provides a concise, production-ready workflow to migrate AI image generation from Google Gemini 2.5 Flash Image to BytePlus SeeDream v4.5. It covers environment changes, a reusable REST client, API route updates, dependency cleanup, testing, and documentation updates. The goal is a reliable, maintainable swap with better resolution support and predictable error handling.

How this skill works

The skill inspects existing Gemini integration patterns and replaces them with a BytePlus REST client that uses fetch and Bearer token headers. It validates environment variables, maps model parameters (model id, size, mode), converts base64 payloads into data URIs, and standardizes error handling for common HTTP statuses. Finally, it updates API routes, removes Gemini SDK dependencies, and includes tests and validation steps to confirm successful migration.

When to use it

  • You currently use Gemini 2.5 Flash Image and want to switch to BytePlus SeeDream v4.5.
  • You need higher resolution outputs (up to 4K) or stricter control of pixel dimensions.
  • You want to move from an SDK-based integration to a REST-based client (fetch).
  • You’re optimizing cost, image quality, or expanding supported output formats (BMP, TIFF, GIF).
  • You need a clear checklist for environment, routing, testing, and documentation updates.

Best practices

  • Validate BYTEPLUS_API_KEY in environment validators before any request.
  • Use data URI format (data:image/<type>;base64,...) — BytePlus requires it, not raw base64.
  • Implement comprehensive error handling for 400, 401, 429, and 500 with clear messages and retry/backoff for 429/500.
  • Keep a reusable client module that returns a consistent interface (imageUrl, usage, error).
  • Test with fixed pixel sizes (e.g., 2048x2560) and both 'standard' and 'fast' modes to tune quality vs latency.

Example use cases

  • Replace Gemini SDK calls in Next.js API routes with generateImageWithByteplus from a lib client.
  • Migrate environment and CI checks to require BYTEPLUS_API_KEY and remove GEMINI_API_KEY references.
  • Switch a mobile backend to produce 4K-capable assets for high-res product previews.
  • Lower runtime costs by selecting 'fast' mode for previews and 'standard' for final renders.
  • Add support for additional output formats (GIF/TIFF) and update frontend to accept data URI responses.

FAQ

No. The recommended approach is a native REST client using fetch and a Bearer token; no SDK required.

What common errors should I prepare for after migration?

Handle 400 (invalid payload), 401 (invalid API key), 429 (rate limiting with backoff), and 500 (service errors with retry).

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational