Skip to content

feat(cli): image generation + catalog refresh (v0.2.0)#1

Merged
raullenchai merged 1 commit into
mainfrom
feat/image-gen-v0.2.0
May 27, 2026
Merged

feat(cli): image generation + catalog refresh (v0.2.0)#1
raullenchai merged 1 commit into
mainfrom
feat/image-gen-v0.2.0

Conversation

@raullenchai

Copy link
Copy Markdown
Contributor

What

Bring qsp current with the platform: add image generation and refresh the model catalog. Last release (v0.1.2) predates the catalog expansion, FLUX image launch, etc.

New: qsp image "PROMPT"

Text-to-image via /v1/images/generations, saves to disk. Default model flux.2-pro.

  • -o FILE (default qsp-image-<ts>.<ext>), --size, -n N, --json.
  • -n N loops client-side (the endpoint accepts only n=1); each is a separate request/charge, written the moment its request succeeds so a later failure never discards already-paid images.
  • Extension always reflects the actual returned format (sniffed per image) — never a mislabeled file; warns when it differs from a requested extension.
  • --json streams each response (one object for n=1, JSONL for n>1).
  • Malformed responses / bad base64 / disk errors fail cleanly (no tracebacks).

Refreshed qsp models

  • Splits chat vs image-generation tables (image bills per image, not per token; the live /models endpoint doesn't expose per-image price, so it's carried in the CLI).
  • Pre-signin fallback updated to the current lineup + prices (verified 2026-05-26). _is_image_model is a strict allowlist so token-priced gemini-*-image correctly stays in the chat table.

Other

  • Default chat model deepseek-v3deepseek-v4-flash (cheaper, faster, 1M context). QSP_IMAGE_MODEL env added.
  • pyproject description/keywords + README updated for image gen.
  • run() gained a json.JSONDecodeError handler (CLI-wide).

Verification

End-to-end against the live public API (flux.1-schnell): single + named output, -n indexing, --json (single object & JSONL), extension-override warning, bad-output-dir clean failure, both model tables. Reviewed to P1=P2=0 (5 codex rounds; money-adjacent path).

🤖 Generated with Claude Code

Add `qsp image "PROMPT"` — text-to-image via /v1/images/generations,
saves to disk (b64 or URL), default model flux.2-pro. `-n` loops
client-side since the endpoint only accepts n=1; `-o` honours the
user's filename and warns when the returned format differs.

Refresh `qsp models`: split chat vs image-generation tables (image
models bill per image, not per token; the live /models endpoint
doesn't expose per-image price, so it's carried in the CLI). Update
the hardcoded pre-signin fallback to the current lineup + prices
(verified 2026-05-26). Default chat model deepseek-v3 -> deepseek-v4-flash.

Update pyproject description/keywords + README for image gen.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@raullenchai raullenchai merged commit 25d99c4 into main May 27, 2026
3 checks passed
@raullenchai raullenchai deleted the feat/image-gen-v0.2.0 branch May 27, 2026 01:04
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