@@ -134,19 +134,22 @@ def update_image_visibility(platform, aliyun_model, ark_duration, zhipu_model):
134134 zhipu_quality = gr .Dropdown (
135135 choices = ["speed" , "quality" ],
136136 label = "输出模式" ,
137- value = "speed"
137+ value = "speed" ,
138+ visible = True # 默认显示,动态调整
138139 )
139140 zhipu_audio = gr .Checkbox (label = "生成AI音效" , value = False )
140141 zhipu_size = gr .Dropdown (
141142 choices = ["720x480" , "1024x1024" , "1280x960" , "960x1280" , "1920x1080" , "1080x1920" , "2048x1080" ,
142143 "3840x2160" ],
143144 label = "分辨率" ,
144- value = "1920x1080"
145+ value = "1920x1080" ,
146+ visible = True # 默认显示,动态调整
145147 )
146148 zhipu_fps = gr .Dropdown (
147149 choices = [30 , 60 ],
148150 label = "帧率 (FPS)" ,
149- value = 30
151+ value = 30 ,
152+ visible = True # 默认显示,动态调整
150153 )
151154
152155 with gr .Row ():
@@ -159,22 +162,23 @@ def update_image_visibility(platform, aliyun_model, ark_duration, zhipu_model):
159162
160163
161164 # 动态显示逻辑
162- def update_visibility (platform ):
165+ def update_visibility (platform , zhipu_model ):
166+ is_zhipu_flash = platform == "智谱AI" and zhipu_model == "CogVideoX-Flash"
163167 return (
164168 gr .update (visible = platform == "阿里云百炼" ), # aliyun_model
165169 gr .update (visible = platform == "智谱AI" ), # zhipu_model
166170 gr .update (visible = platform == "火山引擎" ), # ark_params
167171 gr .update (visible = platform == "阿里云百炼" ), # bailian_params
168172 gr .update (visible = platform == "智谱AI" ), # zhipu_params
169- gr .update (visible = platform == "智谱AI" and "cogvideox-flash" not in zhipu_model . value ), # zhipu_quality
170- gr .update (visible = platform == "智谱AI" and "cogvideox-flash" not in zhipu_model . value ), # zhipu_size
171- gr .update (visible = platform == "智谱AI" and "cogvideox-flash" not in zhipu_model . value ) # zhipu_fps
173+ gr .update (visible = platform == "智谱AI" and not is_zhipu_flash ), # zhipu_quality
174+ gr .update (visible = platform == "智谱AI" and not is_zhipu_flash ), # zhipu_size
175+ gr .update (visible = platform == "智谱AI" and not is_zhipu_flash ) # zhipu_fps
172176 )
173177
174178
175179 platform .change (
176180 fn = update_visibility ,
177- inputs = platform ,
181+ inputs = [ platform , zhipu_model ] ,
178182 outputs = [aliyun_model , zhipu_model , ark_params , bailian_params , zhipu_params , zhipu_quality , zhipu_size ,
179183 zhipu_fps ]
180184 )
@@ -200,9 +204,9 @@ def update_visibility(platform):
200204 )
201205 zhipu_model .change (
202206 fn = lambda zhipu_model : (
203- gr .update (visible = "cogvideox-flash" not in zhipu_model ),
204- gr .update (visible = "cogvideox-flash" not in zhipu_model ),
205- gr .update (visible = "cogvideox-flash" not in zhipu_model )
207+ gr .update (visible = zhipu_model != "CogVideoX-Flash" ),
208+ gr .update (visible = zhipu_model != "CogVideoX-Flash" ),
209+ gr .update (visible = zhipu_model != "CogVideoX-Flash" )
206210 ),
207211 inputs = zhipu_model ,
208212 outputs = [zhipu_quality , zhipu_size , zhipu_fps ]
0 commit comments