修复了2个bug

This commit is contained in:
andy committed 2026-09-02 17:02:02 +08:00
1 parent ce8372e878
commit 2a64dc7395
64 files changed
+1050 -39

No files matched your search

+2 -2
View File
@@ -40,6 +40,7 @@ import {
type SeedreamAnnotation,
type SeedreamCreationMode
} from "@/lib/seedream/creation";
import { hasCompleteSeedreamLayerMetadata } from "@/lib/seedream/layer-composition";
import type { BillingQuote } from "@/lib/types";
type GenerateMode = "image" | "video";
@@ -2132,8 +2133,7 @@ function seedreamLayerOutputs(job: GenerationJob, outputAssets: Asset[]): Seedre
const raw = asRecord(response.raw);
const values = Array.isArray(raw.data) ? raw.data : [];
const records = values.map(asRecord);
const mode = taskImageCreationMode(job);
if (mode !== "layers" && !records.some((record) => numericValue(record.z_index) !== undefined)) return [];
if (!hasCompleteSeedreamLayerMetadata(records, outputAssets.length)) return [];
return outputAssets.map((asset, index) => {
const record = records[index] || {};
const boundingBox = asRecord(record.bounding_box);
+14 -16
View File
@@ -272,11 +272,11 @@ export function SeedreamWorkspace({
</div>
)}
{sources.length ? (
{mode === "interactive" && sources.length ? (
<div className="seedream-source-picker">
<div className="seedream-source-picker-head">
<span>{mode === "interactive" ? `输入图片 ${selectedSources.length}/${maximumInteractiveSources}` : "选择待拆图片"}</span>
{mode === "interactive" ? <small>图片编号按选中顺序生成,用于“图1 / 图2”坐标提示词</small> : null}
<span>{`输入图片 ${selectedSources.length}/${maximumInteractiveSources}`}</span>
<small>图片编号按选中顺序生成,用于“图1 / 图2”坐标提示词</small>
</div>
<div>
{sources.map((material) => {
@@ -291,7 +291,7 @@ export function SeedreamWorkspace({
title={material.name || material.label}
aria-pressed={key === sourceKey}
onClick={() => {
if (mode === "interactive" && !included) {
if (!included) {
onToggleSource(material);
return;
}
@@ -301,18 +301,16 @@ export function SeedreamWorkspace({
<img src={materialPreviewUrl(material)} alt="" />
<span>{material.name || material.label || "图片"}</span>
</button>
{mode === "interactive" ? (
<button
type="button"
className="seedream-source-toggle"
aria-label={included ? `移除${material.name || "图片"}` : `加入${material.name || "图片"}`}
title={included ? "不参与本次生成" : selectionLimitReached ? "最多选择 10 张图片" : "参与本次生成"}
disabled={!included && selectionLimitReached}
onClick={() => onToggleSource(material)}
>
{included ? <><Check size={12} />图{imageIndex}</> : <><X size={12} />未选</>}
</button>
) : null}
<button
type="button"
className="seedream-source-toggle"
aria-label={included ? `移除${material.name || "图片"}` : `加入${material.name || "图片"}`}
title={included ? "不参与本次生成" : selectionLimitReached ? "最多选择 10 张图片" : "参与本次生成"}
disabled={!included && selectionLimitReached}
onClick={() => onToggleSource(material)}
>
{included ? <><Check size={12} />图{imageIndex}</> : <><X size={12} />未选</>}
</button>
</article>
);
})}