mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +00:00
feature: isEnabled flag added & hardcoding deleted
This commit is contained in:
@@ -236,5 +236,15 @@ describe('useNodeReplacementStore', () => {
|
||||
|
||||
expect(fetchNodeReplacements).toHaveBeenCalledOnce()
|
||||
})
|
||||
|
||||
it('should not call API when setting is disabled', async () => {
|
||||
vi.mocked(fetchNodeReplacements).mockResolvedValue(mockReplacements)
|
||||
store = createStore(false)
|
||||
|
||||
await store.load()
|
||||
|
||||
expect(fetchNodeReplacements).not.toHaveBeenCalled()
|
||||
expect(store.isLoaded).toBe(false)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -15,7 +15,7 @@ export const useNodeReplacementStore = defineStore('nodeReplacement', () => {
|
||||
)
|
||||
|
||||
async function load() {
|
||||
if (isLoaded.value) return
|
||||
if (!isEnabled.value || isLoaded.value) return
|
||||
|
||||
try {
|
||||
replacements.value = await fetchNodeReplacements()
|
||||
|
||||
@@ -1137,13 +1137,6 @@ export class ComfyApp {
|
||||
return
|
||||
}
|
||||
for (let n of nodes) {
|
||||
// TODO: Remove hardcoded patches after node replacement API is implemented
|
||||
// if (n.type == 'T2IAdapterLoader') n.type = 'ControlNetLoader'
|
||||
// if (n.type == 'ConditioningAverage ') n.type = 'ConditioningAverage'
|
||||
// if (n.type == 'SDV_img2vid_Conditioning') n.type = 'SVD_img2vid_Conditioning'
|
||||
// if (n.type == 'Load3DAnimation') n.type = 'Load3D'
|
||||
// if (n.type == 'Preview3DAnimation') n.type = 'Preview3D'
|
||||
|
||||
// Find missing node types
|
||||
if (!(n.type in LiteGraph.registered_node_types)) {
|
||||
const nodeReplacementStore = useNodeReplacementStore()
|
||||
|
||||
Reference in New Issue
Block a user