[GH-ISSUE #5343] [Feature]: NovelAi Diffusion v5 Support #2954

Closed
opened 2026-10-21 05:58:18 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @ylli-selmani on GitHub (Aug 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5343

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

NovelAI released Diffusion v5 (model IDs nai-diffusion-5-full and nai-diffusion-5-curated). Attempting to generate an image with either model in Marinara Engine results in an internal server error (500). The model is selected successfully but the generation request fails because the code does not recognize v5 model IDs as V4+ models, so the request is sent using the legacy pre-V4 parameter format instead of the params_version: 3 format with v4_prompt / v4_negative_prompt structures that the newer API expects.

Proposed solution

Extend the three hardcoded NovelAI model-name regex patterns to also match v5 model IDs:

image-generation.ts isNovelAiV4Model regex: add |5(?:-(?:curated|full))? to the alternation so nai-diffusion-5-full and nai-diffusion-5-curated are recognized as V4+ models.
image-generation.ts V4.5-specific check (precise reference support): extend to also cover V5.
game-asset-generation.ts duplicated regex: same fix as #1.

This ensures v5 models are routed through the V4+ code path with the correct params_version: 3 and v4_prompt / v4_negative_prompt request structures.

Also, include the new models in model-lists.ts's const IMAGE_GEN_MODELS: KnownModel[] = [], to appear in the Model List for easier picking, than manually writing out the model.

Alternatives considered

Hardcoding v5 as a separate model tier with its own request format. Rejected because NovelAI's v5 API uses the same V4+ parameter format, so extending the existing regex is the minimal correct fix. Also because it'd take a lot of edits, since 4.5 is explicitly mentioned in many, many places as a fallback model, etc.

Additional context

related issue: #5344 - The model list drop down doesn't show the new models, so the user would have to guess the exact id of it.

personal fix Tested locally: after the regex changes, image generation with both nai-diffusion-5-full and nai-diffusion-5-curated succeeds.

this barebones fix would not change the fact that 4.5 is still the fall back model, default model, and mentioned by name is other places.

Screenshot of current behaviour:
Image

Screenshot with local fix:
Image

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • [] I DID NOT read this template and provide the requested details.
Originally created by @ylli-selmani on GitHub (Aug 21, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5343 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? NovelAI released Diffusion v5 (model IDs nai-diffusion-5-full and nai-diffusion-5-curated). Attempting to generate an image with either model in Marinara Engine results in an internal server error (500). The model is selected successfully but the generation request fails because the code does not recognize v5 model IDs as V4+ models, so the request is sent using the legacy pre-V4 parameter format instead of the params_version: 3 format with v4_prompt / v4_negative_prompt structures that the newer API expects. ## Proposed solution Extend the three hardcoded NovelAI model-name regex patterns to also match v5 model IDs: image-generation.ts isNovelAiV4Model regex: add |5(?:-(?:curated|full))? to the alternation so nai-diffusion-5-full and nai-diffusion-5-curated are recognized as V4+ models. image-generation.ts V4.5-specific check (precise reference support): extend to also cover V5. game-asset-generation.ts duplicated regex: same fix as #1. This ensures v5 models are routed through the V4+ code path with the correct params_version: 3 and v4_prompt / v4_negative_prompt request structures. Also, include the new models in model-lists.ts's const IMAGE_GEN_MODELS: KnownModel[] = [], to appear in the Model List for easier picking, than manually writing out the model. ## Alternatives considered Hardcoding v5 as a separate model tier with its own request format. Rejected because NovelAI's v5 API uses the same V4+ parameter format, so extending the existing regex is the minimal correct fix. Also because it'd take a lot of edits, since 4.5 is explicitly mentioned in many, many places as a fallback model, etc. ## Additional context related issue: #5344 - The model list drop down doesn't show the new models, so the user would have to guess the exact id of it. personal fix Tested locally: after the regex changes, image generation with both nai-diffusion-5-full and nai-diffusion-5-curated succeeds. this barebones fix would not change the fact that 4.5 is still the fall back model, default model, and mentioned by name is other places. Screenshot of current behaviour: <img width="431" height="431" alt="Image" src="https://github.com/user-attachments/assets/98abad99-3c15-4846-9478-4619d878deb5" /> Screenshot with local fix: <img width="431" height="597" alt="Image" src="https://github.com/user-attachments/assets/8824a101-b2b2-4abc-a277-039ed180cdf8" /> ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [] I DID NOT read this template and provide the requested details.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#2954
No description provided.