Add 'fit on add' option for image placement

Introduces a 'fit_on_add' boolean option to control whether images are fit to the canvas when added or pasted. Updates image addition and paste logic in Canvas, CanvasLayers, and CanvasView to support new placement modes ('fit', 'center', 'mouse', 'default').
This commit is contained in:
Dariusz L
2025-06-28 19:48:57 +02:00
parent 8ead4176b5
commit 4376a21147
4 changed files with 42 additions and 25 deletions

View File

@@ -167,6 +167,7 @@ class CanvasNode:
def INPUT_TYPES(cls):
return {
"required": {
"fit_on_add": ("BOOLEAN", {"default": False, "label_on": "Fit on Add/Paste", "label_off": "Default Behavior"}),
"trigger": ("INT", {"default": 0, "min": 0, "max": 99999999, "step": 1, "hidden": True}),
"node_id": ("STRING", {"default": "0", "hidden": True}),
},
@@ -230,7 +231,7 @@ class CanvasNode:
_processing_lock = threading.Lock()
def process_canvas_image(self, trigger, node_id, prompt=None, unique_id=None):
def process_canvas_image(self, fit_on_add, trigger, node_id, prompt=None, unique_id=None):
try: