@@ -61,6 +61,28 @@ DEFINE_double(dit_regione_region_threshold,
6161 0.80 ,
6262 " RegionE: cosine threshold for adaptive region partition." );
6363
64+ DEFINE_double (dit_regione_cache_threshold,
65+ 0.03 ,
66+ " RegionE: AVDCache error threshold δ (paper Eq.8). "
67+ " Reuse velocity while 1-accumulate <= threshold. "
68+ " Qwen-Image-Edit default in RegionE inplace.py is 0.03." );
69+
70+ DEFINE_bool (dit_regione_use_avd_gamma,
71+ true ,
72+ " RegionE: use AVDCache with gamma (paper/inplace.py method). "
73+ " Uses the original diffusers 28-step gamma curve, linearly "
74+ " upsampled/downsampled to the actual inference step count. "
75+ " Set false to use fixed skip_interval instead." );
76+
77+ DEFINE_bool (dit_regione_erosion_dilation,
78+ true ,
79+ " RegionE: enable erosion/dilation for region mask cleanup." );
80+
81+ DEFINE_bool (dit_regione_profile,
82+ false ,
83+ " RegionE: print per-step timing breakdown for partial/full DiT and "
84+ " K/V CPU offload." );
85+
6486DEFINE_bool (dit_sp_communication_overlap,
6587 true ,
6688 " Communication & Computation overlap for sequence parallel" );
@@ -141,6 +163,10 @@ void DiTConfig::from_flags() {
141163 XLLM_CONFIG_ASSIGN_FROM_FLAG (dit_cache_end_blocks);
142164 XLLM_CONFIG_ASSIGN_FROM_FLAG (dit_regione_refresh_steps);
143165 XLLM_CONFIG_ASSIGN_FROM_FLAG (dit_regione_region_threshold);
166+ XLLM_CONFIG_ASSIGN_FROM_FLAG (dit_regione_cache_threshold);
167+ XLLM_CONFIG_ASSIGN_FROM_FLAG (dit_regione_use_avd_gamma);
168+ XLLM_CONFIG_ASSIGN_FROM_FLAG (dit_regione_erosion_dilation);
169+ XLLM_CONFIG_ASSIGN_FROM_FLAG (dit_regione_profile);
144170 XLLM_CONFIG_ASSIGN_FROM_FLAG (dit_sp_communication_overlap);
145171 XLLM_CONFIG_ASSIGN_FROM_FLAG (dit_debug_print);
146172 XLLM_CONFIG_ASSIGN_FROM_FLAG (dit_laser_attention_enabled);
@@ -169,6 +195,10 @@ void DiTConfig::from_json(const JsonReader& json) {
169195 XLLM_CONFIG_ASSIGN_FROM_JSON (dit_cache_end_blocks);
170196 XLLM_CONFIG_ASSIGN_FROM_JSON (dit_regione_refresh_steps);
171197 XLLM_CONFIG_ASSIGN_FROM_JSON (dit_regione_region_threshold);
198+ XLLM_CONFIG_ASSIGN_FROM_JSON (dit_regione_cache_threshold);
199+ XLLM_CONFIG_ASSIGN_FROM_JSON (dit_regione_use_avd_gamma);
200+ XLLM_CONFIG_ASSIGN_FROM_JSON (dit_regione_erosion_dilation);
201+ XLLM_CONFIG_ASSIGN_FROM_JSON (dit_regione_profile);
172202 XLLM_CONFIG_ASSIGN_FROM_JSON (dit_sp_communication_overlap);
173203 XLLM_CONFIG_ASSIGN_FROM_JSON (dit_debug_print);
174204 XLLM_CONFIG_ASSIGN_FROM_JSON (dit_laser_attention_enabled);
@@ -210,6 +240,14 @@ void DiTConfig::append_config_json(nlohmann::ordered_json& config_json) const {
210240 config_json, default_config, dit_regione_refresh_steps);
211241 APPEND_CONFIG_JSON_VALUE_IF_NOT_DEFAULT (
212242 config_json, default_config, dit_regione_region_threshold);
243+ APPEND_CONFIG_JSON_VALUE_IF_NOT_DEFAULT (
244+ config_json, default_config, dit_regione_cache_threshold);
245+ APPEND_CONFIG_JSON_VALUE_IF_NOT_DEFAULT (
246+ config_json, default_config, dit_regione_use_avd_gamma);
247+ APPEND_CONFIG_JSON_VALUE_IF_NOT_DEFAULT (
248+ config_json, default_config, dit_regione_erosion_dilation);
249+ APPEND_CONFIG_JSON_VALUE_IF_NOT_DEFAULT (
250+ config_json, default_config, dit_regione_profile);
213251 APPEND_CONFIG_JSON_VALUE_IF_NOT_DEFAULT (
214252 config_json, default_config, dit_sp_communication_overlap);
215253 APPEND_CONFIG_JSON_VALUE_IF_NOT_DEFAULT (
0 commit comments