[GH-ISSUE #4693] [Issue]: NovelAI style plate sends raw Fidelity instead of inverted (1 - fidelity), washing out style transfer #2570

Closed
opened 2026-10-21 05:50:22 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @jswen4-tech on GitHub (Aug 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4693

Originally assigned to: @SpicyMarinara on GitHub.

Summary

The integrated NovelAI V4.5 style plate sends director_reference_secondary_strength_values
as the raw Fidelity value, but NovelAI's Fidelity control is inverted on the wire
(1 - fidelity). At high Fidelity this sends a near-maximal secondary strength
where a near-zero value is intended, producing washed-out, flatter, lower-fidelity
style transfer that does not match NovelAI's web UI at identical settings.

Expected behavior

With a Precise reference set to Style at Strength 0.4 / Fidelity 1, Marinara's
output should match the NovelAI web UI at the same settings.

Actual behavior

Marinara's output is flatter and washed-out (weaker shading/contrast) compared to
the web UI at identical Strength/Fidelity/steps/guidance/rescale/sampler. The cause
is a missing Fidelity inversion when building the director-reference parameters.

Location in source

packages/server/dist/services/image/image-generation.js, in the NovelAI request
builder:

parameters.director_reference_secondary_strength_values = directorReferenceImages.map(
  (_, index) => index < styleReferenceOffset ? defaults.styleReferenceFidelity : 0
);

director_reference_secondary_strength_values is sent as the raw Fidelity value.
NovelAI's Fidelity slider maps inverted to this field: UI Fidelity 1 corresponds to
secondary strength 0. So Fidelity 1 currently sends 1 instead of 0.

Suggested fix

Invert the style plate's Fidelity when populating the secondary strength values:

parameters.director_reference_secondary_strength_values = directorReferenceImages.map(
  (_, index) => index < styleReferenceOffset ? (1 - defaults.styleReferenceFidelity) : 0
);

Confirmed locally: with this change, Strength 0.4 / Fidelity 1 in Marinara produces
output matching the NovelAI web UI at the same settings; without it, the result is
washed-out. Verified across multiple Fidelity values, not just 1.

Steps to reproduce

  1. NovelAI Diffusion 4.5 Full connection, Precise reference image set to Style.
  2. Strength 0.4, Fidelity 1, 28 steps, guidance 7, Euler Ancestral, karras,
    guidance rescale 0.7, landscape.
  3. Generate the same prompt in the NovelAI web UI with identical settings and reference.
  4. Compare: Marinara's result is flatter/washed-out relative to the web UI.

Impact area

  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • React-free engine behavior, contracts, agents, or capability ports

Environment

  • Version: v2.4.1
  • Run mode: Windows
  • Provider: NovelAI Diffusion 4.5 Full (nai-diffusion-4-5-full)
  • Feature: NovelAI V4.5 style plate (Precise reference set to Style)

Uploaded the fixed version to this bug report.

image-generation.js

Originally created by @jswen4-tech on GitHub (Aug 6, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4693 Originally assigned to: @SpicyMarinara on GitHub. ## Summary The integrated NovelAI V4.5 style plate sends `director_reference_secondary_strength_values` as the raw Fidelity value, but NovelAI's Fidelity control is inverted on the wire (`1 - fidelity`). At high Fidelity this sends a near-maximal secondary strength where a near-zero value is intended, producing washed-out, flatter, lower-fidelity style transfer that does not match NovelAI's web UI at identical settings. ## Expected behavior With a Precise reference set to Style at Strength 0.4 / Fidelity 1, Marinara's output should match the NovelAI web UI at the same settings. ## Actual behavior Marinara's output is flatter and washed-out (weaker shading/contrast) compared to the web UI at identical Strength/Fidelity/steps/guidance/rescale/sampler. The cause is a missing Fidelity inversion when building the director-reference parameters. ## Location in source `packages/server/dist/services/image/image-generation.js`, in the NovelAI request builder: ```js parameters.director_reference_secondary_strength_values = directorReferenceImages.map( (_, index) => index < styleReferenceOffset ? defaults.styleReferenceFidelity : 0 ); ``` `director_reference_secondary_strength_values` is sent as the raw Fidelity value. NovelAI's Fidelity slider maps inverted to this field: UI Fidelity 1 corresponds to secondary strength 0. So Fidelity 1 currently sends 1 instead of 0. ## Suggested fix Invert the style plate's Fidelity when populating the secondary strength values: ```js parameters.director_reference_secondary_strength_values = directorReferenceImages.map( (_, index) => index < styleReferenceOffset ? (1 - defaults.styleReferenceFidelity) : 0 ); ``` Confirmed locally: with this change, Strength 0.4 / Fidelity 1 in Marinara produces output matching the NovelAI web UI at the same settings; without it, the result is washed-out. Verified across multiple Fidelity values, not just 1. ## Steps to reproduce 1. NovelAI Diffusion 4.5 Full connection, Precise reference image set to Style. 2. Strength 0.4, Fidelity 1, 28 steps, guidance 7, Euler Ancestral, karras, guidance rescale 0.7, landscape. 3. Generate the same prompt in the NovelAI web UI with identical settings and reference. 4. Compare: Marinara's result is flatter/washed-out relative to the web UI. ## Impact area - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [x] React-free engine behavior, contracts, agents, or capability ports ## Environment - Version: v2.4.1 - Run mode: Windows - Provider: NovelAI Diffusion 4.5 Full (`nai-diffusion-4-5-full`) - Feature: NovelAI V4.5 style plate (Precise reference set to Style) Uploaded the fixed version to this bug report. [image-generation.js](https://github.com/user-attachments/files/30802393/image-generation.js)
bsakaguchi 2026-10-21 05:50:22 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Aug 6, 2026):

Claimed by @SpicyMarinara. Implementation and validation are being tracked in draft PR #4697.

<!-- gh-comment-id:5209516927 --> @SpicyMarinara commented on GitHub (Aug 6, 2026): Claimed by @SpicyMarinara. Implementation and validation are being tracked in draft PR #4697.
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#2570
No description provided.