Skip to content

Instantly share code, notes, and snippets.

@artandmath
Created October 30, 2025 01:26
Show Gist options
  • Select an option

  • Save artandmath/efe242ee619230cb1c2c39b09655437b to your computer and use it in GitHub Desktop.

Select an option

Save artandmath/efe242ee619230cb1c2c39b09655437b to your computer and use it in GitHub Desktop.
Automatic MorphDissolve with bbox attention
set cut_paste_input [stack 0]
version 15.1 v1
BackdropNode {
inputs 0
name BackdropNode10
tile_color 0x388e8e00
label "AutoMorph with bbox attention"
note_font_size 25
selected true
xpos 3762
ypos -1444
bdwidth 396
bdheight 343
}
BackdropNode {
inputs 0
name BackdropNode11
tile_color 0x388e8e00
label "AutoMorph with bbox attention"
note_font_size 25
selected true
xpos 3212
ypos -1444
bdwidth 396
bdheight 343
}
BackdropNode {
inputs 0
name BackdropNode12
tile_color 0x688e8eff
label "Adjust crop to the area where MorphDissolve\nwill focus its attention. Doing so will reduce required compute."
note_font_size 12
selected true
xpos 3763
ypos -1593
bdwidth 395
bdheight 113
}
BackdropNode {
inputs 0
name BackdropNode13
tile_color 0x688e8eff
label "Adjust crop to the area where MorphDissolve\nwill focus its attention. Doing so will reduce required compute."
note_font_size 12
selected true
xpos 3213
ypos -1593
bdwidth 395
bdheight 113
}
Crop {
inputs 0
box {256 256 768 768}
crop false
name Crop11
selected true
xpos 3370
ypos -1521
}
Dot {
name Dot63
selected true
xpos 3404
ypos -1278
}
set N6c726000 [stack 0]
push $cut_paste_input
SmartVector {
name SmartVector2
selected true
xpos 3040
ypos -1431
}
Dot {
name Dot207
selected true
xpos 3074
ypos -1350
}
Dot {
name Dot221
selected true
xpos 3294
ypos -1350
}
set Nfb77fc00 [stack 0]
Dot {
name Dot222
selected true
xpos 3514
ypos -1350
}
VectorDistort {
inputs 2
referenceFrame 1010
reference_frame_set true
name AutoMorphVectorDistortTo1
selected true
xpos 3480
ypos -1305
}
push $N6c726000
push $Nfb77fc00
VectorDistort {
inputs 2
referenceFrame 1001
reference_frame_set true
name AutoMorphVectorDistortFrom1
selected true
xpos 3260
ypos -1305
}
Group {
inputs 2
name AutoMorphDissolve1
help "Allows to morph between two moving plates automatically, or can be used to improve manual Morphs."
tile_color 0x890074ff
label "(Plate \[value morph])"
selected true
xpos 3371
ypos -1191
addUserKnob {20 User}
addUserKnob {7 morph l Morph t "Morphs between input 0 and input 1"}
morph {{"t<=\[value input0.referenceFrame]?0:t>=\[value input1.referenceFrame]?1:(t-\[value input0.referenceFrame])/(\[value input1.referenceFrame]-\[value input0.referenceFrame])"}}
addUserKnob {26 ""}
addUserKnob {4 method l "Morph Method" t "Pick which method to use. They may both display artifacts in different areas, try both to see which one produces the best results for your specific morph." M {iDistort Kronos ""}}
method Kronos
addUserKnob {41 useGPUIfAvailable l "Use GPU if available" T Kronos1.useGPUIfAvailable}
addUserKnob {7 vectorDetail l "Vector Detail" t "Use this to adjust the density of the calculated motion vector field. Higher details capture finer movements, but take will longer to calculate." R 0.01 1}
vectorDetail 0.75
addUserKnob {7 strength l Strength t "Match Strength : Stonger values will match larger differences between the two plates." R 0 1.5}
strength 1.5
addUserKnob {41 black_outside l "black outside" T Transform1.black_outside}
addUserKnob {26 ""}
addUserKnob {26 copyright l "" +STARTLINE T "v1.0 - by Erwan Leroy - 2017\nmodded by Dan Harkness for bbox attention - 2025"}
}
BackdropNode {
inputs 0
name Backdrop1
tile_color 0x5b4e5658
label Zipping
note_font_size 40
xpos 570
ypos -49
bdwidth 180
bdheight 241
}
Input {
inputs 0
name Input0
xpos -40
ypos -633
}
Dot {
name Dot5
xpos -6
ypos -558
}
set Nf681c800 [stack 0]
Input {
inputs 0
name Input1
xpos 1390
ypos -633
number 1
}
Dot {
name Dot6
xpos 1424
ypos -534
}
set N6e5a9000 [stack 0]
MergeExpression {
inputs 2
name MergeExpression1
xpos -260
ypos -537
}
Dot {
name INPUTS
label "Union BBox"
note_font_size 22
xpos -226
ypos -481
}
Dot {
name Dot15
xpos -226
ypos -438
}
set N6e149400 [stack 0]
push $N6e5a9000
CopyBBox {
inputs 2
name CopyBBox2
xpos 1390
ypos -441
}
Crop {
box {{floor(bbox.x)} {floor(bbox.y)} {ceil(bbox.r)} {ceil(bbox.t)}}
reformat true
crop false
name Crop2
xpos 1390
ypos -345
}
Dot {
name Dot3
tile_color 0xcccccc00
xpos 1424
ypos -246
}
set Nfc457000 [stack 0]
Dot {
name Dot8
tile_color 0xcccccc00
xpos 1424
ypos 1122
}
push $Nfc457000
Dot {
name Dot13
tile_color 0xcccccc00
xpos 1204
ypos -246
}
NoTimeBlur {
rounding floor
single false
name NoTimeBlur2
xpos 1170
ypos -177
}
Retime {
input.first 1001
input.first_lock true
output.first 1001
output.last 1002
speed 0.5
before continue
after continue
filter none
time ""
name Retime2
label "x\[value input.first]-->x\[value output.first]\n\[if \{\[value speed] == 1\} then \{return \"\"\} else \{return \"spd \[value speed]\"\}]"
xpos 1170
ypos -141
}
push $N6e149400
push $Nf681c800
CopyBBox {
inputs 2
name CopyBBox1
xpos -40
ypos -393
}
Crop {
box {{floor(bbox.x)} {floor(bbox.y)} {ceil(bbox.r)} {ceil(bbox.t)}}
reformat true
crop false
name Crop1
xpos -40
ypos -345
}
Dot {
name Dot4
tile_color 0xcccccc00
xpos -6
ypos -246
}
set N6e148c00 [stack 0]
Dot {
name Dot14
tile_color 0xcccccc00
xpos 214
ypos -246
}
NoTimeBlur {
rounding floor
single false
name NoTimeBlur1
xpos 180
ypos -177
}
Retime {
input.first 1001
input.first_lock true
input.last 1218
output.first 1001
output.last 1436
speed 0.5
before continue
after continue
filter none
time ""
name Retime1
label "x\[value input.first]-->x\[value output.first]\n\[if \{\[value speed] == 1\} then \{return \"\"\} else \{return \"spd \[value speed]\"\}]"
xpos 180
ypos -141
}
Switch {
inputs 2
which {{(frame-1001)%2}}
patterns {
{i0 ""}
{i1 ""}
}
name Switch1
xpos 620
ypos -129
}
Dot {
name Dot9
tile_color 0xcccccc00
xpos 654
ypos 114
}
set N6e459000 [stack 0]
Dot {
name Dot2
tile_color 0xcccccc00
xpos 984
ypos 114
}
Kronos {
retimedChannels all
timing2 Frame
timingFrame2 {{(frame-1001)*2+1001+parent.morph}}
motionEstimation Regularized
vectorDetailReg {{parent.vectorDetail}}
strengthReg {{parent.strength}}
name Kronos1
xpos 950
ypos 273
}
Dot {
name Dot12
tile_color 0xcccccc00
xpos 984
ypos 858
}
push $N6e459000
Dot {
name Dot10
tile_color 0xcccccc00
xpos 434
ypos 114
}
VectorGenerator {
useGPUIfAvailable {{parent.Kronos1.useGPUIfAvailable.main}}
motionEstimation Regularized
vectorDetailReg {{parent.vectorDetail}}
strengthReg {{parent.strength}}
name VectorGenerator1
xpos 400
ypos 273
}
Dot {
name Dot1
tile_color 0xcccccc00
xpos 434
ypos 354
}
set N6b705000 [stack 0]
Shuffle {
in backward
blue black
alpha black
name Shuffle2
label "in \[value in]-->out \[value out]"
xpos 180
ypos 345
}
TimeOffset {
time_offset -1
time ""
name TimeOffset2
label "\[value time_offset]"
xpos 180
ypos 489
}
push $N6b705000
Shuffle {
in forward
blue black
alpha black
name Shuffle1
label "in \[value in]-->out \[value out]"
xpos 620
ypos 345
}
TimeOffset {
time_offset 1
time ""
name TimeOffset1
label "\[value time_offset]"
xpos 620
ypos 417
}
push $N6b705000
Copy {
inputs 2
from0 forward.u
to0 forward.u
from1 forward.v
to1 forward.v
bbox B
name Copy1
xpos 400
ypos 411
}
Copy {
inputs 2
from0 backward.u
to0 backward.u
from1 backward.v
to1 backward.v
bbox B
name Copy2
xpos 400
ypos 483
}
set Nfc457800 [stack 0]
Retime {
input.first 1000
input.first_lock true
input.last 1002
output.first 1000
output.last 1001
speed 2
before continue
after continue
filter none
time ""
name Retime4
label "x\[value input.first]-->x\[value output.first]\n\[if \{\[value speed] == 1\} then \{return \"\"\} else \{return \"spd \[value speed]\"\}]"
xpos 510
ypos 555
}
Clamp {
minimum -1000000
maximum_enable false
name Clamp1
label "bug fix"
xpos 510
ypos 627
}
IDistort {
uv forward
uv_scale {{1-parent.morph}}
name IDistort2
xpos 510
ypos 705
}
push $Nfc457800
Retime {
input.first 1001
input.first_lock true
input.last 1436
output.first 1001
output.last 1218
speed 2
before continue
after continue
filter none
time ""
name Retime3
label "x\[value input.first]-->x\[value output.first]\n\[if \{\[value speed] == 1\} then \{return \"\"\} else \{return \"spd \[value speed]\"\}]"
xpos 290
ypos 555
}
Clamp {
minimum -1000000
maximum_enable false
name Clamp3
label "bug fix"
xpos 290
ypos 627
}
IDistort {
uv backward
uv_scale {{parent.morph}}
name IDistort1
xpos 290
ypos 705
}
Dissolve {
inputs 2
which {{parent.morph}}
name Dissolve1
xpos 400
ypos 777
}
Dot {
name Dot11
tile_color 0xcccccc00
xpos 434
ypos 858
}
Switch {
inputs 2
which {{parent.method}}
patterns {
{i0 ""}
{i1 ""}
}
name Switch3
xpos 620
ypos 855
}
push $N6e148c00
Dot {
name Dot7
tile_color 0xcccccc00
xpos -6
ypos 1122
}
Switch {
inputs 3
which {{parent.morph<=0?0:parent.morph>=1?2:1}}
patterns {
{i0 ""}
{i1 ""}
{i2 ""}
}
name Switch2
xpos 620
ypos 1119
}
Reformat {
type "to box"
box_width {{INPUTS.width}}
box_height {{INPUTS.height}}
box_fixed true
box_pixel_aspect {{INPUTS.pixel_aspect}}
resize none
center false
name Reformat1
xpos 620
ypos 1235
}
Transform {
translate {{Crop1.box.x} {Crop1.box.y}}
center {2304 1582}
black_outside false
shutteroffset centred
name Transform1
xpos 620
ypos 1308
}
Output {
name Output1
xpos 620
ypos 1356
}
end_group
push $cut_paste_input
Crop {
box {256 256 768 768}
crop false
name Crop9
selected true
xpos 3920
ypos -1521
}
Dot {
name Dot61
selected true
xpos 3954
ypos -1374
}
set Nfc7b7400 [stack 0]
FrameHold {
firstFrame 1010
name AutoMorphHoldFrameTo1
selected true
xpos 4030
ypos -1287
}
push $Nfc7b7400
FrameHold {
firstFrame 1001
name AutoMorphHoldFrameFrom1
selected true
xpos 3810
ypos -1287
}
Group {
inputs 2
name AutoMorphDissolve2
help "Allows to morph between two moving plates automatically, or can be used to improve manual Morphs."
tile_color 0x890074ff
label "(Plate \[value morph])"
selected true
xpos 3918
ypos -1191
addUserKnob {20 User}
addUserKnob {7 morph l Morph t "Morphs between input 0 and input 1"}
morph {{"t<=\[value input0.firstFrame]?0:t>=\[value input1.firstFrame]?1:(t-\[value input0.firstFrame])/(\[value input1.firstFrame]-\[value input0.firstFrame])"}}
addUserKnob {26 ""}
addUserKnob {4 method l "Morph Method" t "Pick which method to use. They may both display artifacts in different areas, try both to see which one produces the best results for your specific morph." M {iDistort Kronos ""}}
method Kronos
addUserKnob {41 useGPUIfAvailable l "Use GPU if available" T Kronos1.useGPUIfAvailable}
addUserKnob {7 vectorDetail l "Vector Detail" t "Use this to adjust the density of the calculated motion vector field. Higher details capture finer movements, but take will longer to calculate." R 0.01 1}
vectorDetail 0.75
addUserKnob {7 strength l Strength t "Match Strength : Stonger values will match larger differences between the two plates." R 0 1.5}
strength 1.5
addUserKnob {41 black_outside l "black outside" T Transform1.black_outside}
addUserKnob {26 ""}
addUserKnob {26 copyright l "" +STARTLINE T "v1.0 - by Erwan Leroy - 2017\nmodded by Dan Harkness for bbox attention - 2025"}
}
BackdropNode {
inputs 0
name Backdrop1
tile_color 0x5b4e5658
label Zipping
note_font_size 40
xpos 570
ypos -49
bdwidth 180
bdheight 241
}
Input {
inputs 0
name Input0
xpos -40
ypos -633
}
Dot {
name Dot5
xpos -6
ypos -558
}
set N1039ec00 [stack 0]
Input {
inputs 0
name Input1
xpos 1390
ypos -633
number 1
}
Dot {
name Dot6
xpos 1424
ypos -534
}
set N6ed51400 [stack 0]
MergeExpression {
inputs 2
name MergeExpression1
xpos -260
ypos -537
}
Dot {
name INPUTS
label "Union BBox"
note_font_size 22
xpos -226
ypos -481
}
Dot {
name Dot15
xpos -226
ypos -438
}
set N53029400 [stack 0]
push $N6ed51400
CopyBBox {
inputs 2
name CopyBBox2
xpos 1390
ypos -441
}
Crop {
box {{floor(bbox.x)} {floor(bbox.y)} {ceil(bbox.r)} {ceil(bbox.t)}}
reformat true
crop false
name Crop2
xpos 1390
ypos -345
}
Dot {
name Dot3
tile_color 0xcccccc00
xpos 1424
ypos -246
}
set Nfc7ed400 [stack 0]
Dot {
name Dot8
tile_color 0xcccccc00
xpos 1424
ypos 1122
}
push $Nfc7ed400
Dot {
name Dot13
tile_color 0xcccccc00
xpos 1204
ypos -246
}
NoTimeBlur {
rounding floor
single false
name NoTimeBlur2
xpos 1170
ypos -177
}
Retime {
input.first 1001
input.first_lock true
output.first 1001
output.last 1002
speed 0.5
before continue
after continue
filter none
time ""
name Retime2
label "x\[value input.first]-->x\[value output.first]\n\[if \{\[value speed] == 1\} then \{return \"\"\} else \{return \"spd \[value speed]\"\}]"
xpos 1170
ypos -141
}
push $N53029400
push $N1039ec00
CopyBBox {
inputs 2
name CopyBBox1
xpos -40
ypos -393
}
Crop {
box {{floor(bbox.x)} {floor(bbox.y)} {ceil(bbox.r)} {ceil(bbox.t)}}
reformat true
crop false
name Crop1
xpos -40
ypos -345
}
Dot {
name Dot4
tile_color 0xcccccc00
xpos -6
ypos -246
}
set N1039f800 [stack 0]
Dot {
name Dot14
tile_color 0xcccccc00
xpos 214
ypos -246
}
NoTimeBlur {
rounding floor
single false
name NoTimeBlur1
xpos 180
ypos -177
}
Retime {
input.first 1001
input.first_lock true
input.last 1218
output.first 1001
output.last 1436
speed 0.5
before continue
after continue
filter none
time ""
name Retime1
label "x\[value input.first]-->x\[value output.first]\n\[if \{\[value speed] == 1\} then \{return \"\"\} else \{return \"spd \[value speed]\"\}]"
xpos 180
ypos -141
}
Switch {
inputs 2
which {{(frame-1001)%2}}
patterns {
{i0 ""}
{i1 ""}
}
name Switch1
xpos 620
ypos -129
}
Dot {
name Dot9
tile_color 0xcccccc00
xpos 654
ypos 114
}
set Nbca50c00 [stack 0]
Dot {
name Dot2
tile_color 0xcccccc00
xpos 984
ypos 114
}
Kronos {
retimedChannels all
timing2 Frame
timingFrame2 {{(frame-1001)*2+1001+parent.morph}}
motionEstimation Regularized
vectorDetailReg {{parent.vectorDetail}}
strengthReg {{parent.strength}}
name Kronos1
xpos 950
ypos 273
}
Dot {
name Dot12
tile_color 0xcccccc00
xpos 984
ypos 858
}
push $Nbca50c00
Dot {
name Dot10
tile_color 0xcccccc00
xpos 434
ypos 114
}
VectorGenerator {
useGPUIfAvailable {{parent.Kronos1.useGPUIfAvailable.main}}
motionEstimation Regularized
vectorDetailReg {{parent.vectorDetail}}
strengthReg {{parent.strength}}
name VectorGenerator1
xpos 400
ypos 273
}
Dot {
name Dot1
tile_color 0xcccccc00
xpos 434
ypos 354
}
set Nf681d000 [stack 0]
Shuffle {
in backward
blue black
alpha black
name Shuffle2
label "in \[value in]-->out \[value out]"
xpos 180
ypos 345
}
TimeOffset {
time_offset -1
time ""
name TimeOffset2
label "\[value time_offset]"
xpos 180
ypos 489
}
push $Nf681d000
Shuffle {
in forward
blue black
alpha black
name Shuffle1
label "in \[value in]-->out \[value out]"
xpos 620
ypos 345
}
TimeOffset {
time_offset 1
time ""
name TimeOffset1
label "\[value time_offset]"
xpos 620
ypos 417
}
push $Nf681d000
Copy {
inputs 2
from0 forward.u
to0 forward.u
from1 forward.v
to1 forward.v
bbox B
name Copy1
xpos 400
ypos 411
}
Copy {
inputs 2
from0 backward.u
to0 backward.u
from1 backward.v
to1 backward.v
bbox B
name Copy2
xpos 400
ypos 483
}
set N6e5a8c00 [stack 0]
Retime {
input.first 1000
input.first_lock true
input.last 1002
output.first 1000
output.last 1001
speed 2
before continue
after continue
filter none
time ""
name Retime4
label "x\[value input.first]-->x\[value output.first]\n\[if \{\[value speed] == 1\} then \{return \"\"\} else \{return \"spd \[value speed]\"\}]"
xpos 510
ypos 555
}
Clamp {
minimum -1000000
maximum_enable false
name Clamp1
label "bug fix"
xpos 510
ypos 627
}
IDistort {
uv forward
uv_scale {{1-parent.morph}}
name IDistort2
xpos 510
ypos 705
}
push $N6e5a8c00
Retime {
input.first 1001
input.first_lock true
input.last 1436
output.first 1001
output.last 1218
speed 2
before continue
after continue
filter none
time ""
name Retime3
label "x\[value input.first]-->x\[value output.first]\n\[if \{\[value speed] == 1\} then \{return \"\"\} else \{return \"spd \[value speed]\"\}]"
xpos 290
ypos 555
}
Clamp {
minimum -1000000
maximum_enable false
name Clamp3
label "bug fix"
xpos 290
ypos 627
}
IDistort {
uv backward
uv_scale {{parent.morph}}
name IDistort1
xpos 290
ypos 705
}
Dissolve {
inputs 2
which {{parent.morph}}
name Dissolve1
xpos 400
ypos 777
}
Dot {
name Dot11
tile_color 0xcccccc00
xpos 434
ypos 858
}
Switch {
inputs 2
which {{parent.method}}
patterns {
{i0 ""}
{i1 ""}
}
name Switch3
xpos 620
ypos 855
}
push $N1039f800
Dot {
name Dot7
tile_color 0xcccccc00
xpos -6
ypos 1122
}
Switch {
inputs 3
which {{parent.morph<=0?0:parent.morph>=1?2:1}}
patterns {
{i0 ""}
{i1 ""}
{i2 ""}
}
name Switch2
xpos 620
ypos 1119
}
Reformat {
type "to box"
box_width {{INPUTS.width}}
box_height {{INPUTS.height}}
box_fixed true
box_pixel_aspect {{INPUTS.pixel_aspect}}
resize none
center false
name Reformat1
xpos 620
ypos 1235
}
Transform {
translate {{Crop1.box.x} {Crop1.box.y}}
center {2304 1582}
black_outside false
shutteroffset centred
name Transform1
xpos 620
ypos 1308
}
Output {
name Output1
xpos 620
ypos 1356
}
end_group
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment