fix maximum downsampling option

This commit is contained in:
papuSpartan 2023-05-03 13:12:43 -05:00
parent f08ae96115
commit e960781511
3 changed files with 5 additions and 5 deletions

View File

@ -306,6 +306,8 @@ Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 965400086, Size: 512x512, Model
res["Token merging stride x"] = '2' res["Token merging stride x"] = '2'
if res.get("Token merging stride y", None) is None: if res.get("Token merging stride y", None) is None:
res["Token merging stride y"] = '2' res["Token merging stride y"] = '2'
if res.get("Token merging maximum down sampling", None) is None:
res["Token merging maximum down sampling"] = '1'
restore_old_hires_fix_params(res) restore_old_hires_fix_params(res)
@ -341,7 +343,7 @@ infotext_to_setting_name_mapping = [
('Token merging merge attention', 'token_merging_merge_attention'), ('Token merging merge attention', 'token_merging_merge_attention'),
('Token merging merge cross attention', 'token_merging_merge_cross_attention'), ('Token merging merge cross attention', 'token_merging_merge_cross_attention'),
('Token merging merge mlp', 'token_merging_merge_mlp'), ('Token merging merge mlp', 'token_merging_merge_mlp'),
('Token merging maximum downsampling', 'token_merging_maximum_downsampling'), ('Token merging maximum down sampling', 'token_merging_maximum_down_sampling'),
('Token merging stride x', 'token_merging_stride_x'), ('Token merging stride x', 'token_merging_stride_x'),
('Token merging stride y', 'token_merging_stride_y'), ('Token merging stride y', 'token_merging_stride_y'),
('RNG', 'randn_source'), ('RNG', 'randn_source'),

View File

@ -495,6 +495,7 @@ def create_infotext(p, all_prompts, all_seeds, all_subseeds, comments=None, iter
"Token merging merge mlp": None if opts.token_merging_merge_mlp is False else opts.token_merging_merge_mlp, "Token merging merge mlp": None if opts.token_merging_merge_mlp is False else opts.token_merging_merge_mlp,
"Token merging stride x": None if opts.token_merging_stride_x == 2 else opts.token_merging_stride_x, "Token merging stride x": None if opts.token_merging_stride_x == 2 else opts.token_merging_stride_x,
"Token merging stride y": None if opts.token_merging_stride_y == 2 else opts.token_merging_stride_y, "Token merging stride y": None if opts.token_merging_stride_y == 2 else opts.token_merging_stride_y,
"Token merging maximum down sampling": None if opts.token_merging_maximum_down_sampling == 1 else opts.token_merging_maximum_down_sampling,
"Init image hash": getattr(p, 'init_img_hash', None), "Init image hash": getattr(p, 'init_img_hash', None),
"RNG": opts.randn_source if opts.randn_source != "GPU" else None, "RNG": opts.randn_source if opts.randn_source != "GPU" else None,
"NGMS": None if p.s_min_uncond == 0 else p.s_min_uncond, "NGMS": None if p.s_min_uncond == 0 else p.s_min_uncond,

View File

@ -488,10 +488,7 @@ options_templates.update(options_section(('token_merging', 'Token Merging'), {
False, "Merge mlp", False, "Merge mlp",
gr.Checkbox gr.Checkbox
), ),
"token_merging_maximum_down_sampling": OptionInfo( "token_merging_maximum_down_sampling": OptionInfo(1, "Maximum down sampling", gr.Radio, lambda: {"choices": ['1', '2', '4', '8']}),
1, "Maximum down sampling",
gr.Dropdown, lambda: {"choices": ["1", "2", "4", "8"]}
),
"token_merging_stride_x": OptionInfo( "token_merging_stride_x": OptionInfo(
2, "Stride - X", 2, "Stride - X",
gr.Slider, {"minimum": 2, "maximum": 8, "step": 2} gr.Slider, {"minimum": 2, "maximum": 8, "step": 2}