Skip to content

Commit

Permalink
removed commas from multiline arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
Avaray committed Nov 20, 2024
1 parent bd5860c commit d349808
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ for (const ui of uis) {
// TODO: Need to change logic here, look at extensions list, it contains uis array
pvs = pvs.replace(
/EXTENSIONS=\(.*?\)/gms,
`EXTENSIONS=(\n${extensionUrls.map((x) => ` '${x}'`).join(',\n')}\n)`,
`EXTENSIONS=(\n${extensionUrls.map((x) => ` '${x}'`).join('\n')}\n)`,
);

// Replace CHECKPOINT_MODELS list
Expand All @@ -65,7 +65,7 @@ for (const ui of uis) {
// Replace VAE_MODELS list
pvs = pvs.replace(
/VAE_MODELS=\(.*?\)/gms,
`VAE_MODELS=(\n${vaeModels.map((x) => ` '${url(`${repositories[checkpoint.base]}/VAE/${x}`)}'`).join(',\n')}\n)`,
`VAE_MODELS=(\n${vaeModels.map((x) => ` '${url(`${repositories[checkpoint.base]}/VAE/${x}`)}'`).join('\n')}\n)`,
)

// Find all Lora models where base is checkpoint base
Expand All @@ -76,7 +76,7 @@ for (const ui of uis) {
// Replace LORA_MODELS with all Lora models
pvs = pvs.replace(
/LORA_MODELS=\(.*?\)/gms,
`LORA_MODELS=(\n${loraModels.map((x) => ` '${url(`${repositories[checkpoint.base]}/LORA/${x}`)}'`).join(',\n')}\n)`,
`LORA_MODELS=(\n${loraModels.map((x) => ` '${url(`${repositories[checkpoint.base]}/LORA/${x}`)}'`).join('\n')}\n)`,
);

// Find all ControlNet models where base is checkpoint base
Expand All @@ -87,7 +87,7 @@ for (const ui of uis) {
// Replace CONTROLNET_MODELS with all ControlNet models
pvs = pvs.replace(
/CONTROLNET_MODELS=\(.*?\)/gms,
`CONTROLNET_MODELS=(\n${controlnetModels.map((x) => ` '${url(`${repositories[checkpoint.base]}/CONTROLNET/${x}`)}'`).join(',\n')}\n)`,
`CONTROLNET_MODELS=(\n${controlnetModels.map((x) => ` '${url(`${repositories[checkpoint.base]}/CONTROLNET/${x}`)}'`).join('\n')}\n)`,
)

// Find all Upscaler models where base is checkpoint base
Expand All @@ -98,7 +98,7 @@ for (const ui of uis) {
// Replace ESRGAN_MODELS (upscalers) with all Upscaler models
pvs = pvs.replace(
/ESRGAN_MODELS=\(.*?\)/gms,
`ESRGAN_MODELS=(\n${upscalerModels.map((x) => ` '${url(`${repositories[checkpoint.base]}/ESRGAN/${x}`)}'`).join(',\n')}\n)`,
`ESRGAN_MODELS=(\n${upscalerModels.map((x) => ` '${url(`${repositories[checkpoint.base]}/ESRGAN/${x}`)}'`).join('\n')}\n)`,
)

// List all Embeddings that are compatible with the checkpoint and type === 'positive'
Expand All @@ -114,11 +114,11 @@ for (const ui of uis) {
if (ui.id === 'forge' || ui.id === 'comfy') {
pvs = pvs.replace(
/^function provisioning_start/m,
`EMBEDDINGS_POSITIVE=(\n${embeddingsPositive.map((x) => ` '${url(`${repositories[checkpoint.base]}/EMBEDDINGS/pos/${x}`)}'`).join(',\n')}\n)\n\nfunction provisioning_start`,
`EMBEDDINGS_POSITIVE=(\n${embeddingsPositive.map((x) => ` '${url(`${repositories[checkpoint.base]}/EMBEDDINGS/pos/${x}`)}'`).join('\n')}\n)\n\nfunction provisioning_start`,
);
pvs = pvs.replace(
/^function provisioning_start/m,
`EMBEDDINGS_NEGATIVE=(\n${embeddingsNegative.map((x) => ` '${url(`${repositories[checkpoint.base]}/EMBEDDINGS/neg/${x}`)}'`).join(',\n')}\n)\n\nfunction provisioning_start`,
`EMBEDDINGS_NEGATIVE=(\n${embeddingsNegative.map((x) => ` '${url(`${repositories[checkpoint.base]}/EMBEDDINGS/neg/${x}`)}'`).join('\n')}\n)\n\nfunction provisioning_start`,
);
}

Expand Down

0 comments on commit d349808

Please sign in to comment.