Skip to content

Commit

Permalink
Regenerate default extra_models_config from config.json
Browse files Browse the repository at this point in the history
  • Loading branch information
webfiltered committed Dec 25, 2024
1 parent 660cc21 commit 4be3e71
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/config/comfyServerConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,18 @@ export class ComfyServerConfig {
/** @deprecated Do not use. Tempoary workaround for validation only. */
public static async setBasePathInDefaultConfig(basePath: string): Promise<boolean> {
const parsedConfig = await ComfyServerConfig.readConfigFile(ComfyServerConfig.configPath);
// TODO: Prompt user to attempt this as a troubleshooting option.
if (parsedConfig === null) {
// File does not exist. Just create default.
log.warn("Extra model paths config file doesn't exist. Creating default.");

const comfyDesktopConfig = ComfyServerConfig.getBaseConfig();
comfyDesktopConfig['base_path'] = basePath;

return await ComfyServerConfig.createConfigFile(ComfyServerConfig.configPath, {
comfyui_desktop: comfyDesktopConfig,
});
}
if (!parsedConfig) return false;

parsedConfig.comfyui_desktop ??= {};
Expand Down

0 comments on commit 4be3e71

Please sign in to comment.