File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ class ModelManager:
3939 def __init__ (self , config_file = "config.json" ):
4040 self .config_file = config_file
4141 self .config = self .load_config ()
42- self .models_path = Path (self .config .get ("models_path" , "" ))
42+ self .models_path = Path (self .config .get ("models_path" , "" )) if self . config . get ( "models_path" ) else None
4343 self .api_base_url = "https://civitai.com/api/v1"
4444 self .models_info : Dict [str , Any ] = {}
4545 self .images_path = Path ("static/images" ) # 添加图片保存路径
@@ -304,7 +304,7 @@ async def scan_models_endpoint():
304304async def get_config ():
305305 """获取当前配置"""
306306 return {
307- "models_path" : str (manager .models_path ),
307+ "models_path" : str (manager .models_path ) if manager . models_path else "" ,
308308 "is_path_valid" : os .path .exists (manager .models_path ) if manager .models_path else False
309309 }
310310
Original file line number Diff line number Diff line change 5555 < div class ="row mb-4 ">
5656 < div class ="col ">
5757 < div class ="mb-3 ">
58- < label for ="pathInput " class ="form-label "> 选择模型目录</ label >
5958 < div class ="input-group ">
60- < input type ="text " class ="form-control " id ="pathInput " readonly placeholder ="请选择模型目录 ">
59+ < input type ="text " class ="form-control text-muted " id ="pathInput " readonly placeholder ="请选择模型目录 ">
6160 < button class ="btn btn-outline-secondary " id ="selectPath " type ="button ">
6261 < i class ="bi bi-folder2-open "> </ i > 浏览
6362 </ button >
You can’t perform that action at this time.
0 commit comments