Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
bab73c3
Add AI object mask tool with SAM and SegNext support
andriiryzhkov Feb 21, 2026
2086377
Update model settings
andriiryzhkov Feb 21, 2026
f78f4f3
Add cleanup, smoothing and sign parameters to ras2vect
andriiryzhkov Feb 21, 2026
0581f07
Add segmentation module to darktable_ai library
andriiryzhkov Feb 21, 2026
744383a
Update github_asset to dtmodel
andriiryzhkov Feb 22, 2026
edd5fed
Reduce time-to-first-mask with decoder warmup and lower render resolu…
andriiryzhkov Feb 24, 2026
500c320
Updated default mask post-processing parameters
andriiryzhkov Feb 24, 2026
3168dec
Clip mask overlay to viewport in darkroom expose
andriiryzhkov Feb 24, 2026
ec9b3c2
Mark form names for translation
andriiryzhkov Feb 24, 2026
4c831a3
Add brush tool to object mask for intuitive selection
andriiryzhkov Feb 25, 2026
9399d70
Update object mask icon to sparkle shape and match button order
andriiryzhkov Feb 25, 2026
929efca
Add vectorization preview overlay to object mask
andriiryzhkov Feb 26, 2026
a12600f
Show busy cursor during object mask encoding and decoding
andriiryzhkov Feb 27, 2026
3be65ba
Fix spurious re-encoding after object mask finalization
andriiryzhkov Feb 27, 2026
beccb36
Fix object mask cursor position and hint timing
andriiryzhkov Feb 27, 2026
ad80b00
Remove busy cursor from background image encoding
andriiryzhkov Feb 27, 2026
085173c
Fix comments style
andriiryzhkov Feb 27, 2026
2183747
Update AI model registry
andriiryzhkov Mar 13, 2026
c34deaf
Code style fixes
andriiryzhkov Mar 13, 2026
320caf6
alphamax 0.0 in rasterfile
andriiryzhkov Mar 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion data/ai_models.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
{
"version": 1,
"models": [
]
{
"id": "mask-object-sam21-small",
"name": "mask sam2.1 hiera small",
"description": "Segment Anything 2.1 (Hiera Small) for interactive masking",
"task": "mask",
"github_asset": "mask-object-sam21-small.dtmodel",
"default": true
},
{
"id": "mask-object-segnext-b2hq",
"name": "mask segnext vitb-sax2 hq",
"description": "SegNext ViT-B SAx2 HQ fine-tuned for interactive masking",
"task": "mask",
"github_asset": "mask-object-segnext-b2hq.dtmodel",
"default": false
}
]
}
49 changes: 49 additions & 0 deletions data/darktableconfig.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -3501,6 +3501,55 @@
<shortdescription>height of mask manager view window</shortdescription>
<longdescription>maximum height the masks view in darkroom will grow to before scrolling</longdescription>
</dtconfig>
<dtconfig>
<name>plugins/darkroom/masks/object/cleanup</name>
<type min="0" max="100">int</type>
<default>10</default>
<shortdescription>AI mask cleanup</shortdescription>
<longdescription>area (in pixels²) of the largest speckle to suppress during AI mask vectorization. higher values remove more small artifacts.</longdescription>
</dtconfig>
<dtconfig>
<name>plugins/darkroom/masks/object/smoothing</name>
<type min="0.0" max="1.3">float</type>
<default>1.0</default>
<shortdescription>AI mask smoothing</shortdescription>
<longdescription>corner threshold for AI mask vectorization. 0 = all sharp corners (most points), 1.0 = balanced, 1.3 = maximum smoothing (fewest points).</longdescription>
</dtconfig>
<dtconfig>
<name>plugins/darkroom/masks/object/refine_passes</name>
<type min="1" max="5">int</type>
<default>1</default>
<shortdescription>AI mask refinement passes</shortdescription>
<longdescription>number of iterative decoder passes. each pass feeds back the mask to tighten boundaries. higher values give tighter edges at the cost of more processing time.</longdescription>
</dtconfig>
<dtconfig>
<name>plugins/darkroom/masks/object/threshold</name>
<type min="0.3" max="0.9">float</type>
<default>0.5</default>
<shortdescription>AI mask binarization threshold</shortdescription>
<longdescription>sigmoid threshold for converting AI mask to binary. higher values (0.6-0.7) tighten boundaries, lower values include more area.</longdescription>
</dtconfig>
<dtconfig>
<name>plugins/darkroom/masks/object/morph_radius</name>
<type min="0" max="5">int</type>
<default>3</default>
<shortdescription>AI mask morphological cleanup radius</shortdescription>
<longdescription>radius of structuring element for morphological open+close cleanup. removes small protrusions and fills small holes in the mask. 0 = disabled, 1-3 = typical values.</longdescription>
</dtconfig>
<dtconfig>
<name>plugins/darkroom/masks/object/edge_refine</name>
<type min="0.0" max="0.5">float</type>
<default>0.2</default>
<shortdescription>AI mask edge refinement</shortdescription>
<longdescription>strength of edge-aware threshold boost. near strong image edges the binarization threshold is raised, snapping the mask boundary to object edges. 0 = disabled, 0.1-0.3 = typical values.</longdescription>
</dtconfig>
<dtconfig>
<name>plugins/darkroom/masks/object/brush_size</name>
<type min="0.005" max="0.5">float</type>
<default>0.03</default>
<shortdescription>AI mask brush size</shortdescription>
<longdescription>brush radius as a fraction of the shorter image dimension. used for the brush tool in the AI object mask to paint over the target object.</longdescription>
</dtconfig>
<dtconfig>
<name>plugins/darkroom/ashift/near_delta</name>
<type>float</type>
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ if(USE_AI)

FILE(GLOB SOURCE_FILES_AI
"common/ai_models.c"
"develop/masks/object.c"
"gui/preferences_ai.c"
)
set(SOURCES ${SOURCES} ${SOURCE_FILES_AI})
Expand Down
2 changes: 2 additions & 0 deletions src/ai/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ add_library(darktable_ai STATIC
backend.h
backend_common.c
backend_onnx.c
segmentation.h
segmentation.c
)

# Find ONNX Runtime (auto-downloads if not present)
Expand Down
Loading
Loading