fix(canvas): render generated image thumbnails first
This commit is contained in:
parent
80e9771790
commit
f52ab780f1
@ -2145,6 +2145,7 @@ export function ImageNode({
|
|||||||
updateCurrentGeneratingTaskNode((currentData) => ({
|
updateCurrentGeneratingTaskNode((currentData) => ({
|
||||||
...currentData,
|
...currentData,
|
||||||
src: imageUrl,
|
src: imageUrl,
|
||||||
|
thumbnailUrl: image?.thumbnailUrl || imageUrl,
|
||||||
status: "completed",
|
status: "completed",
|
||||||
prompt: task.result?.prompt || currentData.prompt || "图片生成结果",
|
prompt: task.result?.prompt || currentData.prompt || "图片生成结果",
|
||||||
model: task.result?.model || task.result?.modelRef || currentData.model,
|
model: task.result?.model || task.result?.modelRef || currentData.model,
|
||||||
@ -2471,14 +2472,18 @@ export function ImageNode({
|
|||||||
);
|
);
|
||||||
}, [node.size.width, shouldUseHighFidelityDisplayImage, viewportZoom]);
|
}, [node.size.width, shouldUseHighFidelityDisplayImage, viewportZoom]);
|
||||||
const displayImageQuality = shouldUseHighFidelityDisplayImage ? 92 : 88;
|
const displayImageQuality = shouldUseHighFidelityDisplayImage ? 92 : 88;
|
||||||
|
const displayImageSource =
|
||||||
|
data.thumbnailUrl && !shouldUseHighFidelityDisplayImage
|
||||||
|
? data.thumbnailUrl
|
||||||
|
: data.src;
|
||||||
const displayImageSrc = useMemo(
|
const displayImageSrc = useMemo(
|
||||||
() =>
|
() =>
|
||||||
buildImageProxyUrl(data.src, {
|
buildImageProxyUrl(displayImageSource, {
|
||||||
width: displayImageWidth,
|
width: displayImageWidth,
|
||||||
quality: displayImageQuality,
|
quality: displayImageQuality,
|
||||||
format: "webp",
|
format: "webp",
|
||||||
}),
|
}),
|
||||||
[data.src, displayImageQuality, displayImageWidth]
|
[displayImageQuality, displayImageSource, displayImageWidth]
|
||||||
);
|
);
|
||||||
const fullscreenPreviewSrc = useMemo(() => {
|
const fullscreenPreviewSrc = useMemo(() => {
|
||||||
const originalUrl = resolveOriginalImageUrl(data.src || "");
|
const originalUrl = resolveOriginalImageUrl(data.src || "");
|
||||||
@ -4550,6 +4555,7 @@ export function ImageNode({
|
|||||||
updateNode(newNodeId, {
|
updateNode(newNodeId, {
|
||||||
data: {
|
data: {
|
||||||
src: generatedUrl,
|
src: generatedUrl,
|
||||||
|
thumbnailUrl: generatedImage?.thumbnailUrl || generatedUrl,
|
||||||
status: "completed",
|
status: "completed",
|
||||||
prompt:
|
prompt:
|
||||||
task.result?.prompt ||
|
task.result?.prompt ||
|
||||||
|
|||||||
@ -59,6 +59,7 @@ export interface ImageTextEditItem {
|
|||||||
// 图片节点数据
|
// 图片节点数据
|
||||||
export interface ImageNodeData {
|
export interface ImageNodeData {
|
||||||
src: string;
|
src: string;
|
||||||
|
thumbnailUrl?: string;
|
||||||
assetId?: string;
|
assetId?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
note?: string;
|
note?: string;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user