@@ -71,26 +71,20 @@ def run(self, p, *inputs):
71
71
72
72
73
73
# TODO: some of them may be put into the main ui pane
74
+ # TODO: allow in standalone mode
74
75
def on_ui_settings ():
75
76
section = ('depthmap-script' , "Depthmap extension" )
76
- shared .opts .add_option ("depthmap_script_keepmodels" ,
77
- shared .OptionInfo (False , "Do not unload depth and pix2pix models." ,
78
- section = section ))
79
- shared .opts .add_option ("depthmap_script_boost_rmax" ,
80
- shared .OptionInfo (1600 , "Maximum wholesize for boost (Rmax)" ,
81
- section = section ))
82
- shared .opts .add_option ("depthmap_script_save_ply" ,
83
- shared .OptionInfo (False , "Save additional PLY file with 3D inpainted mesh." ,
84
- section = section ))
85
- shared .opts .add_option ("depthmap_script_show_3d" ,
86
- shared .OptionInfo (True , "Enable showing 3D Meshes in output tab. (Experimental)" ,
87
- section = section ))
88
- shared .opts .add_option ("depthmap_script_show_3d_inpaint" ,
89
- shared .OptionInfo (True , "Also show 3D Inpainted Mesh in 3D Mesh output tab. (Experimental)" ,
90
- section = section ))
91
- shared .opts .add_option ("depthmap_script_mesh_maxsize" ,
92
- shared .OptionInfo (2048 , "Max size for generating simple mesh." ,
93
- section = section ))
77
+
78
+ def add_option (name , default_value , description , name_prefix = 'depthmap_script' ):
79
+ shared .opts .add_option (f"{ name_prefix } _{ name } " , shared .OptionInfo (default_value , description , section = section ))
80
+
81
+ add_option ('keepmodels' , False , "Do not unload depth and pix2pix models." )
82
+ add_option ('boost_rmax' , 1600 , "Maximum wholesize for boost (Rmax)" )
83
+ add_option ('save_ply' , False , "Save additional PLY file with 3D inpainted mesh." )
84
+ add_option ('show_3d' , True , "Enable showing 3D Meshes in output tab. (Experimental)" )
85
+ add_option ('show_3d_inpaint' , True , "Also show 3D Inpainted Mesh in 3D Mesh output tab. (Experimental)" )
86
+ add_option ('mesh_maxsize' , 2048 , "Max size for generating simple mesh." )
87
+ add_option ('gen_heatmap_from_ui' , False , "Show an option to generate HeatMap in the UI" )
94
88
95
89
96
90
from modules import script_callbacks
0 commit comments