Skip to content

feat(novita): MidJourney request shapes (mj-txt2img + 7 edit/ops)#16

Closed
duanbing wants to merge 1 commit into
mainfrom
feat/midjourney-shapes
Closed

feat(novita): MidJourney request shapes (mj-txt2img + 7 edit/ops)#16
duanbing wants to merge 1 commit into
mainfrom
feat/midjourney-shapes

Conversation

@duanbing

Copy link
Copy Markdown

Adds 8 NovitaRequestShape variants for the Novita/PPIO /v3/async/mj-* MidJourney endpoints, consumed by RouterBase's midjourney model family.

Shapes

  • MjTextToImage — maps the prompt onto text (MJ's field; MJ flags like --ar/--stylize ride inside the text). Resolves to a 4-image grid.
  • MjVariation / MjUpscale / MjReroll / MjOutpaint / MjInpaint / MjRemix — operate on a prior task (task_id + image_no); they carry no top-level prompt, so build_body makes prompt optional for them. Their task_id/image_no/type/mode/scale/remix_prompt pass through the per-shape allow-list.
  • MjRemoveBackgroundurl only.

Post-processing

  • Int-coerce image_no/type/mode and float-coerce scale (RouterBase's media surface may ship them as strings; Novita's mj-* schemas are strict).
  • Inpaint: wrap the mask image URL into the {url} object Novita expects (the common B/W-mask case; polygon areas deferred).

cargo check + cargo fmt clean. Single self-contained change to novita.rs.

8 NovitaRequestShape variants for /v3/async/mj-*: text-to-image (prompt->text),
variation, upscale, reroll, outpaint, inpaint, remix, remove-background. The
edit/op shapes carry no top-level prompt (act on a prior task_id/image_no or a
url), so build_body makes prompt optional for them; their task/image refs and
mask/scale/type/mode params pass through the per-shape allow-list.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the Contributor License Agreement (CLA) and hereby sign the CLA.


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@duanbing

Copy link
Copy Markdown
Author

Descoping MidJourney — closing.

@duanbing duanbing closed this Jun 29, 2026
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