diff --git a/src/BuiltinExtensions/ImageBatchTool/Assets/image_batcher.js b/src/BuiltinExtensions/ImageBatchTool/Assets/image_batcher.js
index 3ad171b51..6e70caea3 100644
--- a/src/BuiltinExtensions/ImageBatchTool/Assets/image_batcher.js
+++ b/src/BuiltinExtensions/ImageBatchTool/Assets/image_batcher.js
@@ -1,6 +1,13 @@
class ImageBatcherClass {
+ updateSideLengthModeVisibility() {
+ let isSideLength = getRequiredElementById('ext_image_batcher_res_mode').value == 'Scale Input To Side Length';
+ let useSameSideLength = getRequiredElementById('ext_image_batcher_use_same_side_length').checked;
+ getRequiredElementById('ext_image_batcher_side_length_wrap').style.display = isSideLength ? 'flex' : 'none';
+ getRequiredElementById('ext_image_batcher_output_side_length_wrap').style.display = isSideLength && !useSameSideLength ? 'block' : 'none';
+ }
+
doGenerate() {
resetBatchIfNeeded();
let batch_id = mainGenHandler.getBatchId();
@@ -12,7 +19,10 @@ class ImageBatcherClass {
'revision': getRequiredElementById('ext_image_batcher_use_as_revision').checked,
'controlnet': getRequiredElementById('ext_image_batcher_use_as_controlnet').checked,
'append_filename_to_prompt': getRequiredElementById('ext_image_batcher_append_filename_to_prompt').checked,
- 'resMode': getRequiredElementById('ext_image_batcher_res_mode').value
+ 'resMode': getRequiredElementById('ext_image_batcher_res_mode').value,
+ 'use_same_side_length': getRequiredElementById('ext_image_batcher_use_same_side_length').checked,
+ 'input_side_length': parseInt(getRequiredElementById('ext_image_batcher_input_side_length').value) || 1024,
+ 'output_side_length': parseInt(getRequiredElementById('ext_image_batcher_output_side_length').value) || 1024
};
let timeLastGenHit = [Date.now()];
let images = {};
@@ -40,7 +50,24 @@ class ImageBatcherClass {
+ makeCheckboxInput(null, 'ext_image_batcher_use_as_controlnet', '', 'Use As ControlNet Input', 'Whether to use the image as input to ControlNet (only applies if a ControlNet model is enabled).', true, false, true, true)
+ makeCheckboxInput(null, 'ext_image_batcher_use_as_revision', '', 'Use As Image Prompt', 'Whether to use the image as an Image Prompting input.', false, false, true, true)
+ makeCheckboxInput(null, 'ext_image_batcher_append_filename_to_prompt', '', 'Append Filename to Prompt', 'Whether to append the filename to the prompt.', false, false, true, true)
- + `Resolution: `;
+ + makeGenericPopover('ext_image_batcher_res_mode', 'Resolution', 'Dropdown', `Choose how the batcher sets generation resolution.
From Parameter: Keep the current width and height from the main parameter panel.
From Image: Use each input image's current resolution directly.
Scale To Model: Resize the output resolution to fit the selected model's preferred pixel count while keeping aspect ratio.
Scale To Model Or Above: Like Scale To Model, but never shrink below the input image's current size.
Scale Input To Side Length: Resize the input image so its total pixel count approximates side length squared (e.g. ~1024x1024 pixels at side length 1024), maintaining the original aspect ratio.
`, '')
+ + makeDropdownInput(null, 'ext_image_batcher_res_mode', '', 'Resolution', '', ['From Parameter', 'From Image', 'Scale To Model', 'Scale To Model Or Above', 'Scale Input To Side Length'], 'From Parameter', false, true)
+ + ``
+ + makeCheckboxInput(null, 'ext_image_batcher_use_same_side_length', '', 'Use same side length for input and output', 'When checked, the output resolution matches the scaled input resolution exactly. When unchecked, the output resolution is independently scaled to the Output Side Length squared, maintaining the same aspect ratio.', true, false, true, true)
+ + `