fix(screenshots): lifecycle — wider node spacing, scale 0.72
OllamaChatCompletion grew taller with the new timeout_secs widget. Nodes repositioned with generous horizontal gaps (60→380→720→1200) and scale reduced to 0.72 so the full Load→Chat→Unload chain is visible without overlap. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RWysE6jYn4YjNorLBQ1cXb
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
5ccd569f63
commit
48b84e23c7
Binary file not shown.
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 50 KiB |
+24
-23
@@ -458,28 +458,28 @@ async def scene_ollama_lifecycle(page: Page, out: Path) -> None:
|
||||
async () => {
|
||||
const graph = window.app.graph;
|
||||
|
||||
// OllamaClient — far left
|
||||
// OllamaClient — far left, vertically centred relative to the chain
|
||||
const client = LiteGraph.createNode("OllamaClient");
|
||||
client.pos = [40, 140];
|
||||
client.pos = [60, 300];
|
||||
graph.add(client);
|
||||
const hostWidget = client.widgets && client.widgets.find(w => w.name === "host");
|
||||
if (hostWidget) hostWidget.value = "http://localhost:11434";
|
||||
|
||||
// OllamaLoadModel — centre-left
|
||||
// OllamaLoadModel — generous gap right of client
|
||||
const load = LiteGraph.createNode("OllamaLoadModel");
|
||||
load.pos = [300, 40];
|
||||
load.pos = [380, 80];
|
||||
graph.add(load);
|
||||
|
||||
// OllamaChatCompletion — centre-right
|
||||
// OllamaChatCompletion — wide node, plenty of space to the right of load
|
||||
const chat = LiteGraph.createNode("OllamaChatCompletion");
|
||||
chat.pos = [580, 40];
|
||||
chat.pos = [720, 40];
|
||||
graph.add(chat);
|
||||
const twPrompt = chat.widgets && chat.widgets.find(w => w.name === "prompt");
|
||||
if (twPrompt) twPrompt.value = "Describe this image in one sentence.";
|
||||
|
||||
// OllamaUnloadModel — far right
|
||||
// OllamaUnloadModel — far right, vertically offset to match chat's outputs
|
||||
const unload = LiteGraph.createNode("OllamaUnloadModel");
|
||||
unload.pos = [900, 120];
|
||||
unload.pos = [1200, 280];
|
||||
graph.add(unload);
|
||||
|
||||
// Populate model dropdowns from live Ollama
|
||||
@@ -489,28 +489,27 @@ async def scene_ollama_lifecycle(page: Page, out: Path) -> None:
|
||||
const data = await resp.json();
|
||||
const models = data.models || [];
|
||||
if (models.length) {
|
||||
for (const node of [load, chat]) {
|
||||
const w = node.widgets && node.widgets.find(w => w.name === "model");
|
||||
for (const n of [load, chat]) {
|
||||
const w = n.widgets && n.widgets.find(w => w.name === "model");
|
||||
if (w) { w.options = w.options || {}; w.options.values = models; w.value = models[0]; }
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch(e) {}
|
||||
|
||||
// Wire: client → load.client, client → chat.client, client → unload.client
|
||||
// Wire: client → load, chat, unload
|
||||
client.connect(0, load, 0);
|
||||
client.connect(0, chat, 0);
|
||||
client.connect(0, unload, 0);
|
||||
|
||||
// Wire: load.model_name (output 0) → chat.model_name input (optional)
|
||||
// This forces Load to run before Chat.
|
||||
// Wire: load.model_name → chat.model_name (forces Load before Chat)
|
||||
const chatModelNameSlot = chat.inputs
|
||||
? chat.inputs.findIndex(i => i.name === "model_name")
|
||||
: -1;
|
||||
if (chatModelNameSlot >= 0) load.connect(0, chat, chatModelNameSlot);
|
||||
|
||||
// Wire: chat.model_name (output 2) → unload.model (input 1)
|
||||
// Wire: chat.response (output 0) → unload.passthrough (optional input)
|
||||
// Wire: chat.model_name (output 2) → unload.model
|
||||
// Wire: chat.response (output 0) → unload.passthrough
|
||||
const unloadModelSlot = unload.inputs
|
||||
? unload.inputs.findIndex(i => i.name === "model")
|
||||
: 1;
|
||||
@@ -520,24 +519,26 @@ async def scene_ollama_lifecycle(page: Page, out: Path) -> None:
|
||||
chat.connect(2, unload, unloadModelSlot >= 0 ? unloadModelSlot : 1);
|
||||
if (unloadPassSlot >= 0) chat.connect(0, unload, unloadPassSlot);
|
||||
|
||||
await new Promise(r => setTimeout(r, 1200));
|
||||
// Let nodes render and auto-size before reading bounding box
|
||||
await new Promise(r => setTimeout(r, 1500));
|
||||
window.app.canvas.setDirty(true, true);
|
||||
window.app.canvas.draw(true, true);
|
||||
await new Promise(r => setTimeout(r, 300));
|
||||
|
||||
const nodes = [client, load, chat, unload];
|
||||
const minX = Math.min(...nodes.map(n => n.pos[0])) - 20;
|
||||
const minY = Math.min(...nodes.map(n => n.pos[1])) - 20;
|
||||
const maxX = Math.max(...nodes.map(n => n.pos[0] + n.size[0])) + 20;
|
||||
const maxY = Math.max(...nodes.map(n => n.pos[1] + n.size[1])) + 20;
|
||||
const minX = Math.min(...nodes.map(n => n.pos[0])) - 30;
|
||||
const minY = Math.min(...nodes.map(n => n.pos[1])) - 30;
|
||||
const maxX = Math.max(...nodes.map(n => n.pos[0] + n.size[0])) + 30;
|
||||
const maxY = Math.max(...nodes.map(n => n.pos[1] + n.size[1])) + 30;
|
||||
return { pos: [minX, minY], size: [maxX - minX, maxY - minY] };
|
||||
}
|
||||
"""
|
||||
)
|
||||
|
||||
await asyncio.sleep(2.0)
|
||||
await asyncio.sleep(1.5)
|
||||
await _redraw(page)
|
||||
await _frame_node(page, info["pos"], info["size"], scale=0.85)
|
||||
await _capture(page, out, info["pos"], info["size"], scale=0.85)
|
||||
await _frame_node(page, info["pos"], info["size"], scale=0.72)
|
||||
await _capture(page, out, info["pos"], info["size"], scale=0.72)
|
||||
|
||||
|
||||
async def scene_ollama_options(page: Page, out: Path) -> None:
|
||||
|
||||
Reference in New Issue
Block a user