收紧画布生成输入V2参数恢复

新增按action统一解码生成输入参数
将失效与不兼容参数回落到当前默认值
恢复和再次提交共用规范V2结果并展示告警
记录原地收紧决策与Review处理结果
补充历史模型和非法参数回归测试
This commit is contained in:
2026-08-04 16:24:31 +08:00
parent a9b462d43f
commit 96b06cc39b
8 changed files with 667 additions and 21 deletions
@@ -19,6 +19,7 @@ import {
CHARACTER_ANIMATION_FRAME_DISPLAY_SIZE,
CHARACTER_ANIMATION_FRAME_ORIGINAL_SIZE,
createCanvasLayerReference,
decodeCanvasGenerationInputs,
DEFAULT_IMAGE_MODEL,
DEFAULT_PUBLICATION_GAME_INFO,
DEFAULT_SOUND_EFFECT_DURATION_SECONDS,
@@ -806,10 +807,13 @@ export function getUnavailableNormalizedGenerationInputReferences(
sourceLayer: CanvasLayer,
availableLayers: CanvasLayer[] | undefined,
) {
if (!isNormalizedCanvasGenerationInputs(sourceLayer.generationInputs)) {
const decodedInputs = decodeCanvasGenerationInputs(
sourceLayer.generationInputs,
);
if (!decodedInputs.ok) {
return [];
}
return sourceLayer.generationInputs.references.filter(
return decodedInputs.inputs.references.filter(
(reference) =>
!findAvailableGenerationReferenceLayer(reference, availableLayers),
);
@@ -832,7 +836,7 @@ function resolveNormalizedReferences(
}
function createNormalizedGenerationDialogDraft({
sourceLayer,
sourceLayer: persistedSourceLayer,
canvasSize,
viewport,
availableLayers,
@@ -840,10 +844,17 @@ function createNormalizedGenerationDialogDraft({
CanvasGenerationDialogState,
'id'
> | null {
const inputs = sourceLayer.generationInputs;
if (!isNormalizedCanvasGenerationInputs(inputs)) {
const decodedInputs = decodeCanvasGenerationInputs(
persistedSourceLayer.generationInputs,
);
if (!decodedInputs.ok) {
return null;
}
const inputs = decodedInputs.inputs;
const sourceLayer: CanvasLayer = {
...persistedSourceLayer,
generationInputs: inputs,
};
const prompt = getNormalizedString(sourceLayer, 'prompt');
const references = resolveNormalizedReferences(
sourceLayer,