Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 15, 2025

Summary by CodeRabbit

  • New Features
    • Image upscaling is now available for generation and processing requests, with options for 4MP and 16MP outputs.
    • Added a new transform model option: ByteDance SeeDream v4, expanding creative and quality choices for image transformations.
    • Requests that support these features accept an optional upscale parameter to control output resolution.

@coderabbitai
Copy link

coderabbitai bot commented Sep 15, 2025

Walkthrough

Adds a new UpscaleMode enum and optional upscale field to GenerateImageRequest and ProcessImageRequest. Extends TransformModel enum with bytedance-seedreamv4. All edits are additive in src/libs/Recraft/openapi.yaml and adjust request payload schemas.

Changes

Cohort / File(s) Summary
OpenAPI schema updates
src/libs/Recraft/openapi.yaml
- Added enum UpscaleMode: {upscale4mp, upscale16mp}
- Added optional field GenerateImageRequest.upscale: UpscaleMode
- Added optional field ProcessImageRequest.upscale: UpscaleMode
- Extended TransformModel enum with bytedance-seedreamv4

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant API as Recraft API
  participant IMG as Image Service

  Note over C,API: New optional "upscale" parameter (UpscaleMode)
  C->>API: GenerateImageRequest / ProcessImageRequest<br/>[prompt/assets, transformModel, upscale?]
  API->>IMG: Process image with parameters<br/>[transformModel, upscale?]
  alt upscale provided
    Note over IMG: Apply 4MP/16MP upscaling
  else no upscale
    Note over IMG: Standard processing
  end
  IMG-->>API: Processed image
  API-->>C: Response payload
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • github-actions

Poem

A hare taps keys with nimble cheer,
“Upscale,” it squeaks, “now crystal clear!”
New knobs to twist, new modes to see,
Sixteen or four—pick clarity.
Seedream hops into the fold—
Images bloom, bold on bold.

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The PR title "feat:@coderabbitai" is vague and does not describe the primary changes in the diff; the changes add a new public UpscaleMode enum (upscale4mp, upscale16mp), add optional upscale fields to GenerateImageRequest and ProcessImageRequest, and extend TransformModel with bytedance-seedreamv4 in src/libs/Recraft/openapi.yaml. The title neither summarizes these API additions nor indicates their intent, so it will not help reviewers or future history readers quickly understand the change. For these reasons the title is insufficient. Please update the title to clearly summarize the main change, for example "feat(openapi): add UpscaleMode and optional upscale fields to image requests; add bytedance-seedreamv4". A descriptive title like this will make the PR intent and API impact obvious to reviewers and maintainers.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bot/update-openapi_202509151219

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

@github-actions github-actions bot merged commit c518e5c into main Sep 15, 2025
3 of 4 checks passed
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Add UpscaleMode/upscale to image requests; add bytedance-seedreamv4 Sep 15, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
src/libs/Recraft/openapi.yaml (3)

465-466: Wrap $ref so descriptions/examples aren’t dropped by generators

Many OAS generators ignore sibling fields on $ref. Wrap in allOf to safely attach docs and an example.

-        upscale:
-          $ref: '#/components/schemas/UpscaleMode'
+        upscale:
+          allOf:
+            - $ref: '#/components/schemas/UpscaleMode'
+          description: Optional post‑generation upscaling mode; when omitted, no upscaling is applied.
+          example: upscale4mp

738-739: Clarify applicability to specific endpoints and wrap $ref

ProcessImageRequest is used by ops like removeBackground/vectorize, which may ignore upscale. Document behavior and use allOf to preserve docs in SDKs.

-        upscale:
-          $ref: '#/components/schemas/UpscaleMode'
+        upscale:
+          allOf:
+            - $ref: '#/components/schemas/UpscaleMode'
+          description: Optional upscaling; applied only by endpoints that support upscaling. Safe to include; ignored otherwise.
+          example: upscale16mp

888-891: Add schema‑level description and per‑value hints

Expose intent in SDKs and docs; optional x‑enum descriptions help clients choose wisely.

-    UpscaleMode:
-      enum:
+    UpscaleMode:
+      description: Upscaling target for output images (approximate megapixel goals).
+      x-enumDescriptions:
+        - Upscale to roughly 4 MP; faster/cheaper.
+        - Upscale to roughly 16 MP; higher quality/cost.
+      enum:
         - upscale4mp
         - upscale16mp
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c0624c7 and 7c4c7db.

⛔ Files ignored due to path filters (18)
  • src/libs/Recraft/Generated/Recraft..JsonSerializerContext.g.cs is excluded by !**/generated/**
  • src/libs/Recraft/Generated/Recraft.IImageClient.CreativeUpscale.g.cs is excluded by !**/generated/**
  • src/libs/Recraft/Generated/Recraft.IImageClient.CrispUpscale.g.cs is excluded by !**/generated/**
  • src/libs/Recraft/Generated/Recraft.IImageClient.GenerateImage.g.cs is excluded by !**/generated/**
  • src/libs/Recraft/Generated/Recraft.IImageClient.RemoveBackground.g.cs is excluded by !**/generated/**
  • src/libs/Recraft/Generated/Recraft.IImageClient.VectorizeImage.g.cs is excluded by !**/generated/**
  • src/libs/Recraft/Generated/Recraft.ImageClient.CreativeUpscale.g.cs is excluded by !**/generated/**
  • src/libs/Recraft/Generated/Recraft.ImageClient.CrispUpscale.g.cs is excluded by !**/generated/**
  • src/libs/Recraft/Generated/Recraft.ImageClient.GenerateImage.g.cs is excluded by !**/generated/**
  • src/libs/Recraft/Generated/Recraft.ImageClient.RemoveBackground.g.cs is excluded by !**/generated/**
  • src/libs/Recraft/Generated/Recraft.ImageClient.VectorizeImage.g.cs is excluded by !**/generated/**
  • src/libs/Recraft/Generated/Recraft.JsonConverters.UpscaleMode.g.cs is excluded by !**/generated/**
  • src/libs/Recraft/Generated/Recraft.JsonConverters.UpscaleModeNullable.g.cs is excluded by !**/generated/**
  • src/libs/Recraft/Generated/Recraft.JsonSerializerContextTypes.g.cs is excluded by !**/generated/**
  • src/libs/Recraft/Generated/Recraft.Models.GenerateImageRequest.g.cs is excluded by !**/generated/**
  • src/libs/Recraft/Generated/Recraft.Models.ProcessImageRequest.g.cs is excluded by !**/generated/**
  • src/libs/Recraft/Generated/Recraft.Models.TransformModel.g.cs is excluded by !**/generated/**
  • src/libs/Recraft/Generated/Recraft.Models.UpscaleMode.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/Recraft/openapi.yaml (3 hunks)
🔇 Additional comments (1)
src/libs/Recraft/openapi.yaml (1)

886-887: New model value requires server‑side allowlists/mappings

openapi.yaml and the generated client include "bytedance-seedreamv4", but no allowlist/whitelist/supported-models/feature-flag entries were found in the repo — confirm server-side enums, routing, and quota/feature flags accept "bytedance-seedreamv4" to avoid 400/500.

Locations:

  • src/libs/Recraft/openapi.yaml (TransformModel enum — includes bytedance-seedreamv4)
  • src/libs/Recraft/Generated/Recraft.Models.TransformModel.g.cs (ToValueString/ToEnum mappings include bytedance-seedreamv4)

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.

2 participants