Skip to content

Commit eb5f94d

Browse files
committed
Do not show HeatMap generation UI setting by default
De-clutter the UI
1 parent 9f79bd1 commit eb5f94d

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ images generated by [@semjon00](https://github.com/semjon00) from CC0 photos, mo
2323
## Changelog
2424
* v0.4.2
2525
* rembg update
26+
* some default settings were changed - if the results do not match with what you expect, set settings to the old defaults
27+
* heatmap generation UI option is hidden - if you want to use it, please activate it in the extension settings
28+
* fixed regression - batch processing now saves images while the generation is happening
29+
* other bugfixes
2630
* v0.4.1 standalone mode
2731
* ability to run DepthMap without WebUI (Use main.py. Make sure all the dependencies are installed. The support is not feature-complete.)
2832
* NormalMap generation

scripts/depthmap.py

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,26 +71,20 @@ def run(self, p, *inputs):
7171

7272

7373
# TODO: some of them may be put into the main ui pane
74+
# TODO: allow in standalone mode
7475
def on_ui_settings():
7576
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")
9488

9589

9690
from modules import script_callbacks

src/common_ui.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,10 @@ def main_ui_panel(is_depth_tab):
102102
with gr.Row():
103103
inp += go.NORMALMAP_INVERT, gr.Checkbox(label="Invert")
104104

105-
with gr.Box():
106-
with gr.Row():
107-
inp += go.GEN_HEATMAP, gr.Checkbox(label="Generate HeatMap")
105+
if backbone.get_opt('depthmap_script_gen_heatmap_from_ui', False):
106+
with gr.Box():
107+
with gr.Row():
108+
inp += go.GEN_HEATMAP, gr.Checkbox(label="Generate HeatMap")
108109

109110
with gr.Box():
110111
with gr.Column():

0 commit comments

Comments
 (0)