Engine interface
The adapter contract every generation engine implements.
Each engine exports key, label, isReady(), and generate({ characterPhotoPaths, posePhotoPath, prompt, outputPath, outputSettings, apiKey, model }). isReady() returns { ready, reason? }; generate must write an image to outputPath or throw a clear Error. outputSettings and model are optional and adapters must provide safe defaults.
characterPhotoPaths is an array of 1-4 local file paths (one per person in the generation, in order — this is also the order the prompt text refers to them by, e.g. "Image 1", "Image 2"). Every path must be included in the request to the underlying model; dropping any of them means that person won't appear in the output. prompt (built by lib/promptTemplate.js) already accounts for however many paths were given, so adapters don't need to reason about the count themselves — just forward every image, in order, followed by the pose reference.
Advanced Studio
An engine appears in Advanced Studio when it declares what it can do there:
- Images:
capabilities.freeform, agenerateFreeform({ referencePaths, prompt, outputPath, outputSettings, apiKey, model })method, andimageSettings: { aspectRatios, resolutions: [{ id, label, quality }], defaultResolution, note? }. The node menus are built fromimageSettings;qualityis the valueoutputSettings.qualityreceives. - Video:
capabilities.video,generateVideo(...),videoModelsandmodelDefinition(modelId). - Text (LLM Text nodes):
assistPrompt({ instruction, system })returning{ text }.systemreplaces the default prompt-assistant instructions when given. - Image edits (Image Transform nodes):
transformImage({ inputPath, instruction, context, outputPath })writes a PNG tooutputPathafter editing the image atinputPathasinstructionsays, usingcontext(connected text) as material.outputPathis in a scratch folder the caller removes.
Register the module in engines/index.js; nothing else needs to change.