linoyts's picture
linoyts HF Staff
Qwen-Image 2.1 on WebGPU: 2-step int4 ONNX, diffusers.js pipeline
8f9eb25 verified
Raw History Blame Contribute Delete
387 Bytes
// Same pattern as transformers.js: a class whose instances are functions, so `await pipe({...})` calls `_call`.
export class Callable extends Function {
constructor() {
super();
const closure = function (...args) { return closure._call(...args); };
return Object.setPrototypeOf(closure, new.target.prototype);
}
_call() { throw new Error("_call not implemented"); }
}