First real generation through FunPack's nodes: SD1.5 on this Mac, real weights, a real picture of an apple. Everything before this was static. What it proved, on a real model rather than a fixture: the empty latent takes its shape from SD1.5's own format with no family branch anywhere (1, 4, 64, 64, an IMAGE latent from a pack built for video); the traits read off the live model are predict_eps and spatial_latent; and ALG is correctly absent, saying "needs temporal_latent", rather than running on a model with no time axis. What it found: the absolute-core-import bug again, this time INSIDE A FUNCTION BODY. It imported fine, registered fine, passed 258 tests, and raised at execute time -- during the generation. A suite that imports every module cannot see an import that only happens when a node runs, so the check for it is now static and walks the AST: no module may name `core` anywhere, at any nesting, except through the shim. The dev preview loaded one module in nine. It runs system python, which has neither ComfyUI nor torch, so every module that imports either was absent and the app looked almost empty while reporting nothing. It now re-execs under ComfyUI's interpreter. Looking at the app is meant to be how the app gets tested; it has to see what ComfyUI sees. ALG asked for a mount point no region offered, so its panel vanished in silence. The shell now offers one per stage, and a modules page lists what loaded, what asked for a mount nothing offers, and what failed to import -- absence is correct behaviour and indistinguishable from "never installed", so somewhere has to say which. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
50 lines
1.7 KiB
JavaScript
50 lines
1.7 KiB
JavaScript
// Entry point.
|
|
//
|
|
// The whole of what the app does at startup: build the regions, ask the server
|
|
// what exists, and mount whatever announced itself. Nothing here names a module.
|
|
|
|
import { build } from "./shell/layout.js";
|
|
import { fetchManifest } from "./shell/manifest.js";
|
|
import { mountAll } from "./shell/panels.js";
|
|
import { all as allValues } from "./shell/values.js";
|
|
import { composer } from "./composer/composer.js";
|
|
|
|
const root = document.querySelector("#app");
|
|
|
|
async function start() {
|
|
build(root);
|
|
|
|
let manifest;
|
|
try {
|
|
manifest = await fetchManifest();
|
|
} catch (err) {
|
|
// The one failure the user must see: with no manifest there is no app, so
|
|
// silence here would be an empty window with no explanation.
|
|
root.replaceChildren(composer.emptyState.default({
|
|
icon: "▲",
|
|
title: "Could not reach FunPack",
|
|
hint: `${err.message}. Is ComfyUI running?`,
|
|
}).node);
|
|
return;
|
|
}
|
|
|
|
const { mounted, hidden } = await mountAll(manifest);
|
|
const failed = manifest.failed || [];
|
|
|
|
console.info(`[FunPack] ${mounted.length} module(s) mounted`,
|
|
hidden.length ? `· ${hidden.length} hidden` : "",
|
|
failed.length ? `· ${failed.length} failed to load` : "");
|
|
for (const { id, why } of hidden) console.warn(`[FunPack] ${id} is hidden: ${why}`);
|
|
// These never reached the manifest, so no panel could be missing "in a way
|
|
// the user notices" -- which is exactly why they have to be said. A module
|
|
// that failed to import looks identical to one nobody installed.
|
|
for (const { where, why } of failed) console.warn(`[FunPack] ${where} did not load: ${why}`);
|
|
|
|
window.FunPack = {
|
|
manifest, values: allValues, failed, hidden,
|
|
mounted: mounted.map((m) => m.id),
|
|
};
|
|
}
|
|
|
|
start();
|