Files
jaidaken f09734b0ee
Some checks failed
Python Linting / Run Ruff (push) Has been cancelled
Python Linting / Run Pylint (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.10, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.11, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.12, [self-hosted Linux], stable) (push) Has been cancelled
Full Comfy CI Workflow Runs / test-unix-nightly (12.1, , linux, 3.11, [self-hosted Linux], nightly) (push) Has been cancelled
Execution Tests / test (macos-latest) (push) Has been cancelled
Execution Tests / test (ubuntu-latest) (push) Has been cancelled
Execution Tests / test (windows-latest) (push) Has been cancelled
Test server launches without errors / test (push) Has been cancelled
Unit Tests / test (macos-latest) (push) Has been cancelled
Unit Tests / test (ubuntu-latest) (push) Has been cancelled
Unit Tests / test (windows-2022) (push) Has been cancelled
Add custom nodes, Civitai loras (LFS), and vast.ai setup script
Includes 30 custom nodes committed directly, 7 Civitai-exclusive
loras stored via Git LFS, and a setup script that installs all
dependencies and downloads HuggingFace-hosted models on vast.ai.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 00:56:42 +00:00

71 lines
1.6 KiB
JavaScript

import { ComfyApp, app } from "../../scripts/app.js";
function load_image(str) {
let base64String = canvas.toDataURL('image/png');
let img = new Image();
img.src = base64String;
}
app.registerExtension({
name: "Comfy.Inspire.img",
nodeCreated(node, app) {
if(node.comfyClass == "LoadImage //Inspire") {
let w = node.widgets.find(obj => obj.name === 'image_data');
Object.defineProperty(w, 'value', {
set(v) {
if(v != '[IMAGE DATA]')
w._value = v;
},
get() {
const stackTrace = new Error().stack;
if(!stackTrace.includes('draw') && !stackTrace.includes('graphToPrompt') && stackTrace.includes('app.js')) {
return "[IMAGE DATA]";
}
else {
return w._value;
}
}
});
let set_img_act = (v) => {
node._img = v;
var canvas = document.createElement('canvas');
canvas.width = v[0].width;
canvas.height = v[0].height;
var context = canvas.getContext('2d');
context.drawImage(v[0], 0, 0, v[0].width, v[0].height);
var base64Image = canvas.toDataURL('image/png');
w.value = base64Image;
};
Object.defineProperty(node, 'imgs', {
set(v) {
if (v && !v[0].complete) {
let orig_onload = v[0].onload;
v[0].onload = function(v2) {
if(orig_onload)
orig_onload();
set_img_act(v);
};
}
else {
set_img_act(v);
}
},
get() {
if(this._img == undefined && w.value != '') {
this._img = [new Image()];
if(w.value && w.value != '[IMAGE DATA]')
this._img[0].src = w.value;
}
return this._img;
}
});
}
}
})