This package has created for generate image from generated image and embedded workflow.
Automation for generating image from image.
Add node > pkg39 or Search "39"
Selected image copied to "/ComfyUI/pkg39_images" directory.
Load selected image at the "Load image" node.
Enter dir_path and index to load image.
Create a virtual workflow from embedded workflow in image metadata.
Controls (while selecting the Load image node):
The node can load nodes and values from embedded workflow in loaded image by javascript.
Copy and paste to textarea on commnad node and use it after customize.
var n1 = find(1); // Load image
var n11 = find(11); // VAE Encode
var n12 = find(12); // Load Checkpoint
var n13 = find(13); // KSampler
var n14 = find(14); // VAE Decode
var n15 = find(15); // Save Image
var n21 = find(21); // Upscale Latent
getNode(SAMPLER, n13, "positive", [n12]);
getNode(SAMPLER, n13, "negative", n12);
setValues(n13, { seed: SEED });
setValues(n21, {
width: WIDTH * 1.5,
height: HEIGHT * 1.5,
});
var n2 = find(2); // Load image
var n3 = find(3); // VAE Encode
var n4 = find(4); // Load Checkpoint
var n5 = find(5); // Set Latent Noise Mask
var n6 = find(6); // KSampler
var n8 = find(8); // VAE Decode
var n9 = find(9); // InvertMask
var n10 = find(10); // ImageCompositeMasked
var n11 = find(11); // Save Image
getNode(SAMPLER, n6, "positive", n4);
getNode(SAMPLER, n6, "negative", 4);
var firstSampler = SAMPLERS[0];
var lastSampler = SAMPLER;
var srcSampler = lastSampler; // Last sampler in virtual workflow
var dstSampler = find(2); // KSampler node in actual workflow
var replaceNodes = [1]; // ID of Load Checkpoint node in actual workflow
getNode(srcSampler, dstSampler, "positive", replaceNodes);
getNode(srcSampler, "KSampler", "negative", replaceNodes);
getNode(srcSampler, 2, "latent_image");
getNode("KSampler", dstSampler, "cfg");
var srcSampler = SAMPLER;
var dstSampler = find(2);
// case 1
var widgetValues = getValues(srcSampler);
setValues(dstSampler, widgetValues); // All values
setValues(dstSampler, { seed: SEED }); // Set random seed
// case 2
getNode(srcSampler, dstSampler, "seed"); // Get Seed from image
getNode(srcSampler, dstSampler, "denoise");
if (countQueues >= 5) { stop(); }
sound();
var saveNode = find(11); // Save Image
loadByNode(saveNode);