Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

fix template sorting

pythongosssss77ab2c3f699c
diff --git a/web/extensions/core/nodeTemplates.js b/web/extensions/core/nodeTemplates.js
index 2d4821742..bc9a10864 100644
--- a/web/extensions/core/nodeTemplates.js
+++ b/web/extensions/core/nodeTemplates.js
@@ -164,7 +164,7 @@ class ManageTemplates extends ComfyDialog {
var prev_i = el.dataset.id;
if ( el == this.draggedEl && prev_i != i ) {
- [this.templates[i], this.templates[prev_i]] = [this.templates[prev_i], this.templates[i]];
+ this.templates.splice(i, 0, this.templates.splice(prev_i, 1)[0]);
}
el.dataset.id = i;
});