Optimize node layout: reduce prompt heights and fix canvas overflow
- Limit multiline prompt widgets to 60px height (~3 lines) with scrolling - Increased minHeight from 200 to 600 to prevent canvas extending beyond node - Prompts now more compact while remaining fully functional - Applies to both RegionalPrompterSimple and RegionalPrompterFlux
This commit is contained in:
+19
-1
@@ -203,7 +203,7 @@ function addRegionalPrompterCanvas(node, app) {
|
||||
computeCanvasSize(node, node.size);
|
||||
}, 100);
|
||||
|
||||
return { minWidth: 200, minHeight: 200, widget }
|
||||
return { minWidth: 200, minHeight: 600, widget } // Increased to accommodate canvas + widgets
|
||||
}
|
||||
|
||||
app.registerExtension({
|
||||
@@ -231,6 +231,15 @@ app.registerExtension({
|
||||
// Add canvas after the prompt inputs
|
||||
addRegionalPrompterCanvas(this, app)
|
||||
|
||||
// Limit height of multiline prompt widgets to make node more compact
|
||||
const promptNames = ["background_prompt", "region1_prompt", "region2_prompt", "region3_prompt", "region4_prompt"];
|
||||
for (const w of this.widgets) {
|
||||
if (promptNames.includes(w.name) && w.inputEl) {
|
||||
w.inputEl.style.maxHeight = "60px"; // ~3 lines of text
|
||||
w.inputEl.style.overflowY = "auto";
|
||||
}
|
||||
}
|
||||
|
||||
// Find where index widget should be inserted (after canvas)
|
||||
const indexWidgetStartPos = this.widgets.length;
|
||||
this.index = indexWidgetStartPos;
|
||||
@@ -314,6 +323,15 @@ app.registerExtension({
|
||||
// Add canvas after the prompt inputs
|
||||
addRegionalPrompterCanvas(this, app)
|
||||
|
||||
// Limit height of multiline prompt widgets to make node more compact
|
||||
const promptNames = ["background_prompt", "region1_prompt", "region2_prompt", "region3_prompt", "region4_prompt"];
|
||||
for (const w of this.widgets) {
|
||||
if (promptNames.includes(w.name) && w.inputEl) {
|
||||
w.inputEl.style.maxHeight = "60px"; // ~3 lines of text
|
||||
w.inputEl.style.overflowY = "auto";
|
||||
}
|
||||
}
|
||||
|
||||
// Find where index widget should be inserted (after canvas)
|
||||
const indexWidgetStartPos = this.widgets.length;
|
||||
this.index = indexWidgetStartPos;
|
||||
|
||||
Reference in New Issue
Block a user