Skip to content

feat: add dirtberry#43

Merged
Simplereally merged 4 commits intomainfrom
feat/dirtberry-image-model
Mar 11, 2026
Merged

feat: add dirtberry#43
Simplereally merged 4 commits intomainfrom
feat/dirtberry-image-model

Conversation

@Simplereally
Copy link
Copy Markdown
Owner

@Simplereally Simplereally commented Mar 11, 2026

Summary by CodeRabbit

Release Notes

  • New Features
    • Introduced Dirtberry image generation model with a fixed 9:16 portrait aspect ratio (832×1144 pixels).
    • Pricing set at 0.001 per image. Currently in alpha status.
    • Automatic image optimization for Dirtberry-generated outputs to ensure optimal dimensions.

Crop Dirtberry generations before upload and storage so every surface uses the same dimensions, and add supporting tests/docs for the new pipeline behavior.

Made-with: Cursor
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Mar 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
bloomstudio Ignored Ignored Preview Mar 11, 2026 11:43am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 11, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dd220d08-4df2-4e37-bafc-2dc76721feae

📥 Commits

Reviewing files that changed from the base of the PR and between fbd7052 and 12057dd.

⛔ Files ignored due to path filters (1)
  • convex/_generated/api.d.ts is excluded by !**/_generated/**
📒 Files selected for processing (9)
  • convex/batchProcessor.ts
  • convex/lib/dirtberryCrop.ts
  • convex/lib/index.ts
  • convex/singleGenerationProcessor.ts
  • hooks/queries/use-generate-image.ts
  • hooks/use-generation-settings.ts
  • lib/config/models.ts
  • lib/schemas/pollinations-pricing.schema.ts
  • lib/schemas/pollinations.schema.ts

📝 Walkthrough

Walkthrough

This PR introduces Dirtberry image generation model support with specialized image cropping. It adds a new jimp-based cropping utility, integrates it into batch and single generation processors, registers the Dirtberry model in the configuration and pricing schemas, and updates generation hooks to handle dimension overrides from cropped outputs.

Changes

Cohort / File(s) Summary
Dirtberry Cropping Infrastructure
convex/lib/dirtberryCrop.ts, convex/lib/index.ts
New utility module providing Dirtberry-specific image cropping via jimp, computing crop regions based on trim fraction, and returning crop metadata. Exported constants define source/output dimensions. Library index extends public API with cropping functions and types.
Generation Processors
convex/batchProcessor.ts, convex/singleGenerationProcessor.ts
Both processors now detect Dirtberry models, fetch source dimensions to override generation request parameters, apply cropping post-generation, and use cropped buffers for upload. Updated generationParams stored to reflect final dimensions when cropping occurs, with fallback to original dimensions if cropping fails.
Model Configuration & Pricing
lib/config/models.ts, lib/schemas/pollinations.schema.ts, lib/schemas/pollinations-pricing.schema.ts
New Dirtberry model entry added to MODEL_REGISTRY with fixed 9:16 aspect ratio (832×1144), constraints, and icon/logo definitions. Schema enums extended to recognize "dirtberry" as a known image model. Pricing schema includes Dirtberry entry with 0.001 per-image cost and alpha flag.
Generation Hooks
hooks/queries/use-generate-image.ts, hooks/use-generation-settings.ts
GeneratedImage construction now merges original params with dimension overrides from cropped output (width/height). Single-tier fixed-size model detection now uses explicit preset dimensions instead of computed standard dimensions; multi-tier behavior unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A new model hops into view,
Dirtberry arrives with dimensions true,
Cropped just right by jimp's keen eye,
Nine by sixteen—a portrait sky!
Generation flows now know the way. ✨

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/dirtberry-image-model

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Delete temporary Dirtberry research/test files and revert incidental test-only changes so the branch only contains implementation code.

Made-with: Cursor
@Simplereally Simplereally merged commit 3676d7d into main Mar 11, 2026
2 of 3 checks passed
@Simplereally Simplereally deleted the feat/dirtberry-image-model branch March 11, 2026 11:44
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db11a87d64

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +228 to +232
} catch (cropError) {
console.error(
`${logger} Dirtberry crop failed, falling back to original image:`,
cropError
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Sync persisted dimensions when Dirtberry crop falls back

When cropDirtberryImageBuffer throws, this branch logs and keeps going with the original buffer, but outputWidth/outputHeight stay at the pre-crop request values (params.width/height, typically 832x1144 for Dirtberry). Because the upstream request is forced to source dimensions (832x1216), a crop failure stores metadata that no longer matches the uploaded asset, which can skew aspect-ratio-dependent rendering and downloaded dimension expectations; the same pattern is present in convex/batchProcessor.ts.

Useful? React with 👍 / 👎.

Comment on lines +112 to +114
inputMime && JIMP_ENCODABLE_MIME_TYPES.has(inputMime as JimpEncodableMime)
? (inputMime as JimpEncodableMime)
: "image/jpeg"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve output MIME when Dirtberry is re-encoded

This fallback forces outputMime to image/jpeg for any input MIME Jimp cannot encode, but the processors still upload with the original response content-type header and derive the file extension from it. If Dirtberry (or a future variant) returns something like image/webp, the code will upload JPEG bytes labeled as WebP, leading to incorrect metadata/content-type and potential decode issues for clients.

Useful? React with 👍 / 👎.

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