feat: 修复genlab多个saveimage选择bug

This commit is contained in:
li
2025-08-13 17:19:50 +08:00
parent 98a66f9c67
commit 5ce301b9e8
14 changed files with 133 additions and 108 deletions
@@ -1,7 +1,7 @@
function getImportPath(filename) {
return `./${filename}`;
}
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["copilot_web/workflowChat-C9h-eMxD.js","copilot_web/vendor-markdown-BAJQc3l1.js","copilot_web/vendor-react-Dixhfmvb.js","copilot_web/message-components-DqEWs4wC.js","copilot_web/input.js","copilot_web/assets/input-Bz_gfS5D.css","copilot_web/fonts.css"].map(path => {
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["copilot_web/workflowChat-CYKHI-9t.js","copilot_web/vendor-markdown-BAJQc3l1.js","copilot_web/vendor-react-Dixhfmvb.js","copilot_web/message-components-DqEWs4wC.js","copilot_web/input.js","copilot_web/assets/input-Dx1yyZQD.css","copilot_web/fonts.css"].map(path => {
const apiBase = window.comfyAPI?.api?.api?.api_base;
if (apiBase) {
// 有 API base 时,使用完整路径
@@ -11,4 +11,4 @@ function getImportPath(filename) {
return `./${path}`;
}
}))))=>i.map(i=>d[i]);
import{_ as a}from"./input.js";import{j as o}from"./vendor-markdown-BAJQc3l1.js";import{r as t,R as i}from"./vendor-react-Dixhfmvb.js";import{C as n}from"./message-components-DqEWs4wC.js";const s={EXPLAIN_NODE:"copilot:explain-node",TOOLBOX_USAGE:"copilot:toolbox-usage",TOOLBOX_PARAMETERS:"copilot:toolbox-parameters",TOOLBOX_DOWNSTREAMNODES:"copilot:toolbox-downstreamnodes"},d=i.lazy(()=>a(()=>import(getImportPath("workflowChat-C9h-eMxD.js")).then(e=>e.w),__vite__mapDeps([0,1,2,3,4,5,6])).then(e=>({default:e.default})));function c(){const[e,r]=t.useState(!1);return t.useEffect(()=>{const l=()=>{r(!0)};return window.addEventListener(s.EXPLAIN_NODE,l),()=>window.removeEventListener(s.EXPLAIN_NODE,l)},[]),o.jsx(n,{children:o.jsx("div",{className:"h-full w-full flex flex-col",children:o.jsx(t.Suspense,{fallback:o.jsx("div",{className:"h-full w-full flex items-center justify-center",children:"Loading..."}),children:o.jsx(d,{visible:!0,triggerUsage:e,onUsageTriggered:()=>r(!1)})})})})}const O=Object.freeze(Object.defineProperty({__proto__:null,default:c},Symbol.toStringTag,{value:"Module"}));export{O as A,s as C};
import{_ as a}from"./input.js";import{j as o}from"./vendor-markdown-BAJQc3l1.js";import{r as t,R as i}from"./vendor-react-Dixhfmvb.js";import{C as n}from"./message-components-DqEWs4wC.js";const s={EXPLAIN_NODE:"copilot:explain-node",TOOLBOX_USAGE:"copilot:toolbox-usage",TOOLBOX_PARAMETERS:"copilot:toolbox-parameters",TOOLBOX_DOWNSTREAMNODES:"copilot:toolbox-downstreamnodes"},d=i.lazy(()=>a(()=>import(getImportPath("workflowChat-CYKHI-9t.js")).then(e=>e.w),__vite__mapDeps([0,1,2,3,4,5,6])).then(e=>({default:e.default})));function c(){const[e,r]=t.useState(!1);return t.useEffect(()=>{const l=()=>{r(!0)};return window.addEventListener(s.EXPLAIN_NODE,l),()=>window.removeEventListener(s.EXPLAIN_NODE,l)},[]),o.jsx(n,{children:o.jsx("div",{className:"h-full w-full flex flex-col",children:o.jsx(t.Suspense,{fallback:o.jsx("div",{className:"h-full w-full flex items-center justify-center",children:"Loading..."}),children:o.jsx(d,{visible:!0,triggerUsage:e,onUsageTriggered:()=>r(!1)})})})})}const O=Object.freeze(Object.defineProperty({__proto__:null,default:c},Symbol.toStringTag,{value:"Module"}));export{O as A,s as C};
@@ -1,4 +1,4 @@
function getImportPath(filename) {
return `./${filename}`;
}
import{j as e}from"./vendor-markdown-BAJQc3l1.js";import{b as f,c as h,B as m,p as u,R as w}from"./message-components-DqEWs4wC.js";import{r as k}from"./vendor-react-Dixhfmvb.js";import{B as j}from"./workflowChat-C9h-eMxD.js";import"./input.js";/* empty css */import"./App-CycnsMiR.js";const v=i=>{const{title:a="",isWorkflowUpdate:d=!1,className:n="",children:c}=i,[s,r]=k.useState(!1);return e.jsx(j,{className:"rounded-lg ",borderClassName:"rounded-lg",children:e.jsxs("div",{className:`flex flex-col ${n} ${s?"":"max-h-[200px]"}`,children:[e.jsxs("div",{className:"flex justify-between items-center pb-2 border-b border-gray-100",children:[e.jsx("div",{children:typeof a=="string"?e.jsx("h3",{className:"text-sm text-[#fff] font-medium",children:a}):a}),e.jsx("button",{onClick:()=>{r(!s)},children:s?e.jsx(f,{className:"text-gray-700"}):e.jsx(h,{className:"text-gray-700"})})]}),e.jsx("div",{className:"overflow-hidden flex-1",children:c})]})})};function B({content:i,name:a="Assistant",avatar:d,format:n="markdown"}){const c=()=>{let s=null,r=!1,o;try{if(o=JSON.parse(i),o.ext){let t=o.ext.find(l=>l.type==="workflow_rewrite_checkpoint"||l.type==="debug_checkpoint"&&l.data?.checkpoint_type==="workflow_rewrite_start");t&&t.data&&t.data.checkpoint_id?(s=t.data.checkpoint_id,r=!0):(t=o.ext.find(l=>l.type==="workflow_rewrite_complete"),t&&t.data&&t.data.version_id?(s=t.data.version_id,r=!0):(t=o.ext.find(l=>l.type==="debug_checkpoint"),t&&t.data&&t.data.checkpoint_id&&(s=t.data.checkpoint_id,r=!1))),o.ext.find(l=>l.type==="workflow_update")&&(r=!0)}}catch(t){return console.error("Failed to parse DebugResult content:",t),null}const x=r?e.jsxs("div",{className:"flex items-center text-green-500",children:[e.jsx("svg",{className:"w-5 h-5 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),e.jsx("h4",{className:"font-bold text-xl",children:"Workflow Updated Successfully"})]}):e.jsxs("div",{className:"flex items-center text-gray-900",children:[e.jsx("svg",{className:"w-5 h-5 mr-2",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"28108",fill:"currentColor",children:e.jsx("path",{d:"M401.048025 844.855924c0 20.341281 16.643052 36.984333 36.984333 36.984333l147.936307 0c20.341281 0 36.984333-16.643052 36.984333-36.984333L622.952998 807.872614 401.048025 807.872614 401.048025 844.855924zM512 142.159744c-142.943596 0-258.888282 115.944686-258.888282 258.888282 0 88.021729 44.011376 165.503405 110.951975 212.288964l0 83.58365c0 20.341281 16.643052 36.984333 36.984333 36.984333l221.903949 0c20.341281 0 36.984333-16.643052 36.984333-36.984333l0-83.58365c66.941622-46.784536 110.951975-124.266212 110.951975-212.288964C770.888282 258.104429 654.943596 142.159744 512 142.159744zM617.588827 552.682561l-31.621185 22.005176 0 85.248569L438.031335 659.936307l0-85.063351L406.41015 552.866756c-49.743938-34.764781-79.33079-91.350544-79.33079-151.634536 0-101.890598 83.029018-184.92064 184.92064-184.92064s184.92064 83.029018 184.92064 184.92064C696.919617 461.332017 667.332764 517.91778 617.588827 552.682561z","p-id":"28277"})}),e.jsx("h4",{className:"font-bold text-xl",children:"Workflow Updated Finished"})]}),p=r?e.jsx("div",{className:"mt-3 text-xs text-gray-700",children:"💡 If you're not satisfied with the changes, click the restore button to revert to the previous version."}):null;return e.jsxs("div",{className:"sticky top-0 left-0 w-full bg-gray-100 p-4 rounded-lg overflow-hidden",children:[e.jsx(v,{title:x,isWorkflowUpdate:r,className:"p-4",children:e.jsxs("div",{className:"prose prose-sm max-w-none",children:[n==="markdown"?e.jsx(u,{response:o||{}}):e.jsx("pre",{className:"whitespace-pre-wrap text-gray-700 text-sm leading-relaxed h-full",children:o?.text||""}),p]})}),e.jsx("div",{className:"flex justify-end mt-2",children:!!s&&e.jsx("div",{className:"ml-2 flex-shrink-0",children:e.jsx(w,{checkpointId:s,onRestore:()=>{console.log(`Workflow restored from ${r?"workflow update":"debug"} checkpoint`)},title:r?`Restore to this version (Version ${s})`:`Restore checkpoint ${s}`})})})]})};return e.jsx(m,{name:a,children:c()})}export{B as DebugResult};
import{j as e}from"./vendor-markdown-BAJQc3l1.js";import{b as f,c as h,B as m,p as u,R as w}from"./message-components-DqEWs4wC.js";import{r as k}from"./vendor-react-Dixhfmvb.js";import{B as j}from"./workflowChat-CYKHI-9t.js";import"./input.js";/* empty css */import"./App-BX7ITfYK.js";const v=i=>{const{title:a="",isWorkflowUpdate:d=!1,className:n="",children:c}=i,[s,r]=k.useState(!1);return e.jsx(j,{className:"rounded-lg ",borderClassName:"rounded-lg",children:e.jsxs("div",{className:`flex flex-col ${n} ${s?"":"max-h-[200px]"}`,children:[e.jsxs("div",{className:"flex justify-between items-center pb-2 border-b border-gray-100",children:[e.jsx("div",{children:typeof a=="string"?e.jsx("h3",{className:"text-sm text-[#fff] font-medium",children:a}):a}),e.jsx("button",{onClick:()=>{r(!s)},children:s?e.jsx(f,{className:"text-gray-700"}):e.jsx(h,{className:"text-gray-700"})})]}),e.jsx("div",{className:"overflow-hidden flex-1",children:c})]})})};function B({content:i,name:a="Assistant",avatar:d,format:n="markdown"}){const c=()=>{let s=null,r=!1,o;try{if(o=JSON.parse(i),o.ext){let t=o.ext.find(l=>l.type==="workflow_rewrite_checkpoint"||l.type==="debug_checkpoint"&&l.data?.checkpoint_type==="workflow_rewrite_start");t&&t.data&&t.data.checkpoint_id?(s=t.data.checkpoint_id,r=!0):(t=o.ext.find(l=>l.type==="workflow_rewrite_complete"),t&&t.data&&t.data.version_id?(s=t.data.version_id,r=!0):(t=o.ext.find(l=>l.type==="debug_checkpoint"),t&&t.data&&t.data.checkpoint_id&&(s=t.data.checkpoint_id,r=!1))),o.ext.find(l=>l.type==="workflow_update")&&(r=!0)}}catch(t){return console.error("Failed to parse DebugResult content:",t),null}const x=r?e.jsxs("div",{className:"flex items-center text-green-500",children:[e.jsx("svg",{className:"w-5 h-5 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),e.jsx("h4",{className:"font-bold text-xl",children:"Workflow Updated Successfully"})]}):e.jsxs("div",{className:"flex items-center text-gray-900",children:[e.jsx("svg",{className:"w-5 h-5 mr-2",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"28108",fill:"currentColor",children:e.jsx("path",{d:"M401.048025 844.855924c0 20.341281 16.643052 36.984333 36.984333 36.984333l147.936307 0c20.341281 0 36.984333-16.643052 36.984333-36.984333L622.952998 807.872614 401.048025 807.872614 401.048025 844.855924zM512 142.159744c-142.943596 0-258.888282 115.944686-258.888282 258.888282 0 88.021729 44.011376 165.503405 110.951975 212.288964l0 83.58365c0 20.341281 16.643052 36.984333 36.984333 36.984333l221.903949 0c20.341281 0 36.984333-16.643052 36.984333-36.984333l0-83.58365c66.941622-46.784536 110.951975-124.266212 110.951975-212.288964C770.888282 258.104429 654.943596 142.159744 512 142.159744zM617.588827 552.682561l-31.621185 22.005176 0 85.248569L438.031335 659.936307l0-85.063351L406.41015 552.866756c-49.743938-34.764781-79.33079-91.350544-79.33079-151.634536 0-101.890598 83.029018-184.92064 184.92064-184.92064s184.92064 83.029018 184.92064 184.92064C696.919617 461.332017 667.332764 517.91778 617.588827 552.682561z","p-id":"28277"})}),e.jsx("h4",{className:"font-bold text-xl",children:"Workflow Updated Finished"})]}),p=r?e.jsx("div",{className:"mt-3 text-xs text-gray-700",children:"💡 If you're not satisfied with the changes, click the restore button to revert to the previous version."}):null;return e.jsxs("div",{className:"sticky top-0 left-0 w-full bg-gray-100 p-4 rounded-lg overflow-hidden",children:[e.jsx(v,{title:x,isWorkflowUpdate:r,className:"p-4",children:e.jsxs("div",{className:"prose prose-sm max-w-none",children:[n==="markdown"?e.jsx(u,{response:o||{}}):e.jsx("pre",{className:"whitespace-pre-wrap text-gray-700 text-sm leading-relaxed h-full",children:o?.text||""}),p]})}),e.jsx("div",{className:"flex justify-end mt-2",children:!!s&&e.jsx("div",{className:"ml-2 flex-shrink-0",children:e.jsx(w,{checkpointId:s,onRestore:()=>{console.log(`Workflow restored from ${r?"workflow update":"debug"} checkpoint`)},title:r?`Restore to this version (Version ${s})`:`Restore checkpoint ${s}`})})})]})};return e.jsx(m,{name:a,children:c()})}export{B as DebugResult};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -93,12 +93,13 @@ import {
handleApplySelected as utilsHandleApplySelected,
handleClose as utilsHandleClose
} from './utils/stateManagementUtils';
import { isObj } from '../../utils/tools';
// Note: Removed duplicate interface definitions to use imported types instead
export const enum StateKey {
CurrentSceen = 'currentSceen',
CurrentScreen = 'currentScreen',
SelectedParams = 'selectedParams',
TaskId = 'taskId',
TaskId = 'task_id',
IsProcessing = 'isProcessing',
IsCompleted = 'isCompleted',
CompletedCount = 'completedCount',
@@ -308,7 +309,6 @@ export const ParameterDebugInterface: React.FC<ParameterDebugInterfaceProps> = (
};
const doSaveState = (key: StateKey, value: any) => {
console.log('key--->', key, value)
const stateToSave = {
currentScreen,
selectedParams,
@@ -325,20 +325,21 @@ export const ParameterDebugInterface: React.FC<ParameterDebugInterfaceProps> = (
currentPage,
textInputs
};
console.log('doSaveState-->', stateToSave)
const prev = (stateToSave as any)[key as any];
const nextForKey = isObj(prev) && isObj(value) ? { ...prev, ...value } : value;
saveStateToLocalStorage({
...stateToSave,
[key]: value
[key]: nextForKey
});
}
const updateState = (key: StateKey, value: any) => {
switch(key) {
case StateKey.CurrentSceen:
case StateKey.CurrentScreen:
setCurrentScreen(value)
break;
case StateKey.SelectedParams:
setSelectedParams(value)
setSelectedParams(prev => isObj(prev) && isObj(value) ? { ...prev, ...value } : value)
break;
case StateKey.TaskId:
setTask_id(value);
@@ -362,10 +363,10 @@ export const ParameterDebugInterface: React.FC<ParameterDebugInterfaceProps> = (
setGeneratedImages(value);
break;
case StateKey.ParamTestValues:
setParamTestValues(value);
setParamTestValues(prev => isObj(prev) && isObj(value) ? { ...prev, ...value } : value);
break;
case StateKey.SearchTerms:
setSearchTerms(value);
setSearchTerms(prev => isObj(prev) && isObj(value) ? { ...prev, ...value } : value);
break;
case StateKey.InputValues:
setInputValues(value);
@@ -477,31 +478,34 @@ export const ParameterDebugInterface: React.FC<ParameterDebugInterfaceProps> = (
}, [visible]);
useEffect(() => {
if (!!isProcessing && !!isInitial.current) {
if (!!isInitial.current) {
isInitial.current = false;
let selectedImageNodeId: number | undefined = 0;
const nodes = Object.values(app.graph._nodes_by_id) as ComfyNode[];
const saveNodeIds: number[] = [];
const previewNodeIds: number[] = [];
for(const node of nodes) {
if(node.type === "SaveImage") {
saveNodeIds.push(node.id);
} else if(node.type === "PreviewImage") {
previewNodeIds.push(node.id);
if (!!isProcessing) {
let selectedImageNodeId: number | undefined = 0;
const nodes = Object.values(app.graph._nodes_by_id) as ComfyNode[];
const saveNodeIds: number[] = [];
const previewNodeIds: number[] = [];
for(const node of nodes) {
if(node.type === "SaveImage") {
saveNodeIds.push(node.id);
} else if(node.type === "PreviewImage") {
previewNodeIds.push(node.id);
}
}
// Combine and set state
const allImageNodeIds = [...saveNodeIds, ...previewNodeIds];
// If there's exactly one node, set it as selected
if(allImageNodeIds.length === 1) {
selectedImageNodeId = allImageNodeIds[0];
} else if(allImageNodeIds.length > 1) {
// If multiple nodes, enable selection warning
selectedImageNodeId = undefined
}
console.log('isProcessing-->', selectedImageNodeId)
handleStartGeneration(undefined, selectedImageNodeId)
}
// Combine and set state
const allImageNodeIds = [...saveNodeIds, ...previewNodeIds];
// If there's exactly one node, set it as selected
if(allImageNodeIds.length === 1) {
selectedImageNodeId = allImageNodeIds[0];
} else if(allImageNodeIds.length > 1) {
// If multiple nodes, enable selection warning
selectedImageNodeId = undefined
}
handleStartGeneration(undefined, selectedImageNodeId)
}
}, [isProcessing])
// Modify the useEffect that loads state to handle loading state
@@ -514,7 +518,7 @@ export const ParameterDebugInterface: React.FC<ParameterDebugInterfaceProps> = (
const savedState = localStorage.getItem(PARAM_DEBUG_STORAGE_KEY);
if (savedState) {
const parsedState = JSON.parse(savedState);
console.log('parsedState-->', parsedState)
// Only restore state if we have selected nodes
if (!selectedNodes || selectedNodes.length === 0) {
console.log("Not restoring parameter debug state: no nodes selected");
@@ -763,6 +767,7 @@ export const ParameterDebugInterface: React.FC<ParameterDebugInterfaceProps> = (
// Handle start generation - Modified to clean up before starting
const handleStartGeneration = async (event?: React.MouseEvent, selectedNodeId?: number) => {
console.log('handleStartGeneration-->', selectedNodeId)
utilsHandleStartGeneration(
paramTestValues,
task_id,
@@ -1,7 +1,7 @@
// Copyright (C) 2025 AIDC-AI
// Licensed under the MIT License.
import React, { useState, useEffect } from 'react';
import React, { useState, useEffect, useRef } from 'react';
import { app } from '../../../utils/comfyapp';
import { useChatContext } from '../../../context/ChatContext';
@@ -75,34 +75,44 @@ export const ConfirmConfigurationScreen: React.FC<ConfirmConfigurationScreenProp
findImageNodes();
}, []);
// Effect to detect node selection from canvas - using click listener like in Screen 1
useEffect(() => {
// Add a listener for node selection via clicks
const handleNodeSelected = () => {
if (!app.canvas.selected_nodes) return;
const selectedNodesOnCanvas = Object.values(app.canvas.selected_nodes) as ComfyNode[];
if (selectedNodesOnCanvas.length === 0) return;
// Get the first selected node
const selectedNode = selectedNodesOnCanvas[0];
if (!selectedNode) return;
// Check if selected node is a SaveImage or PreviewImage node
if (selectedNode.type === "SaveImage" || selectedNode.type === "PreviewImage") {
console.log("Selected image node:", selectedNode.id);
setSelectedImageNodeId(selectedNode.id);
if (selectedNodes?.length > 0) {
const node = selectedNodes?.find(node => node.type === "SaveImage" || node.type === "PreviewImage")
if (!!node) {
setSelectedImageNodeId(node.id)
}
};
}
}, [selectedNodes])
// Effect to detect node selection from canvas - using click listener like in Screen 1
// useEffect(() => {
// // Add a listener for node selection via clicks
// const handleNodeSelected = () => {
// console.log('handleNodeSelected---->', app.canvas.selected_nodes)
// if (!app.canvas.selected_nodes) return;
// const selectedNodesOnCanvas = Object.values(app.canvas.selected_nodes) as ComfyNode[];
// if (selectedNodesOnCanvas.length === 0) return;
// console.log('selectedNodesOnCanvas-->', selectedNodesOnCanvas)
// // Get the first selected node
// const selectedNode = selectedNodesOnCanvas[0];
// if (!selectedNode) return;
// // Check if selected node is a SaveImage or PreviewImage node
// if (selectedNode.type === "SaveImage" || selectedNode.type === "PreviewImage") {
// console.log("Selected image node:", selectedNode.id);
// // setSelectedImageNodeId(selectedNode.id);
// selectedImageNodeId.current = selectedNode.id
// }
// };
// Listen for click events (same as Screen 1)
document.addEventListener('click', handleNodeSelected);
// // Listen for click events (same as Screen 1)
// document.addEventListener('click', handleNodeSelected);
return () => {
document.removeEventListener('click', handleNodeSelected);
};
}, []);
// return () => {
// document.removeEventListener('click', handleNodeSelected);
// };
// }, []);
// Modified start generation function
const startGenerationWithSelectedNode = (event?: React.MouseEvent) => {
@@ -116,7 +126,7 @@ export const ConfirmConfigurationScreen: React.FC<ConfirmConfigurationScreenProp
setShowNodeSelectionWarning(true);
return;
}
console.log('selectedImageNodeId-->', selectedImageNodeId)
// Otherwise, proceed with selected node ID
handleStartGeneration(event, selectedImageNodeId || undefined);
};
@@ -38,7 +38,7 @@ export const ProcessingScreen: React.FC<ProcessingScreenProps> = ({
cleanupPolling();
}
updateState(StateKey.IsProcessing, false);
updateState(StateKey.CurrentSceen, 2);
updateState(StateKey.CurrentScreen, 2);
};
return (
@@ -45,7 +45,10 @@ export const ResultGalleryScreen: React.FC<ResultGalleryScreenProps> = ({
const renderItem = (image: GeneratedImage, index: number) => (
<div
key={index.toString()}
className={`relative flex flex-col rounded-lg overflow-hidden border ${selectedImageIndex === image.index ? 'border-pink-500 ring-2 ring-pink-300' : 'border-gray-200'}`}
className={`relative flex flex-col rounded-lg overflow-hidden border ${selectedImageIndex === index ? 'border-2 border-green-400' : 'border-gray-200'}`}
style={{
boxShadow: selectedImageIndex === index ? 'inset 0 -16px 24px 0 rgba(255, 255, 255, 0.25)' : ''
}}
onClick={(e) => handleSelectImage(index, e)}
>
{/* Zoom icon */}
@@ -75,7 +75,6 @@ export const handleStartGeneration = async (
// Get node ID to use for showing images - Use provided selectedNodeId if available
let showNodeId: number | null = selectedNodeId || null;
// If no selectedNodeId provided, try to get one automatically
if (showNodeId === null) {
const nodeId = getOnlyOneImageNode();
@@ -84,6 +83,7 @@ export const handleStartGeneration = async (
}
}
console.log('showNodeId-->', showNodeId, selectedNodeId)
// If showNodeId is null, we need user selection (handled in ConfirmConfigurationScreen)
if (showNodeId === null) {
setErrorMessage("Please select a SaveImage or PreviewImage node first.");
@@ -79,7 +79,7 @@ export const handleNext = (
// Clear error message
setErrorMessage(null);
updateState(StateKey.CurrentSceen, Math.min(currentScreen + 1, 2))
updateState(StateKey.CurrentScreen, Math.min(currentScreen + 1, 2))
};
/**
@@ -148,7 +148,7 @@ export const handlePrevious = (
updateState(StateKey.ParamTestValues, updatedParamTestValues);
}
updateState(StateKey.CurrentSceen, Math.max(currentScreen - 1, 0));
updateState(StateKey.CurrentScreen, Math.max(currentScreen - 1, 0));
};
/**
+4
View File
@@ -888,6 +888,10 @@
--tw-border-opacity: 1;
border-color: rgb(187 247 208 / var(--tw-border-opacity, 1));
}
.border-green-400 {
--tw-border-opacity: 1;
border-color: rgb(74 222 128 / var(--tw-border-opacity, 1));
}
.border-green-500 {
--tw-border-opacity: 1;
border-color: rgb(34 197 94 / var(--tw-border-opacity, 1));
+4 -1
View File
@@ -6,4 +6,7 @@ export const mergeByKeyCombine = <T extends Record<string, any>>(a: T[], b: T[],
map.set(_key, { ...(map.get(_key) ?? {}), ...item });
}
return Array.from(map.values());
}
}
export const isObj = (value: unknown): value is Record<string, unknown> =>
value !== null && typeof value === 'object' && !Array.isArray(value);