Skip to content

Commit

Permalink
Update readme.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Avaray committed Dec 23, 2024
1 parent c3418ca commit fe8472f
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions readme.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
import { readFile, saveFile } from "./utils.ts";
import process from "node:process";
import { ratings, readFile, saveFile } from "./utils.ts";
import { services } from "./data/services.ts";
import { uis } from "./data/uis.ts";
import { type UI, uis } from "./data/uis.ts";
import { type Checkpoint, checkpoints } from "./data/checkpoints.ts";
import t from "./data/templates.json" with { type: "json" };
import templatesData from "./data/templates.json" with { type: "json" };

// Check if templatesData contains at least one key
if (!Object.keys(templatesData).length) {
console.error("No templates found");
process.exit(1);
}

export interface Template {
// checkpoint ID
Expand All @@ -18,7 +28,7 @@ export interface Template {
};
}

const templates = t as Template;
const templates = templatesData as Template;

let readme = await readFile("src/README.md");

Expand All @@ -28,8 +38,8 @@ const link = (service: string, templateId: string, uiId: string) => {
return `<a href="${url}${templateId}">${_ui?.name}</a>`;
};

const sdxlTemplates = checkpoints.filter((ckpt) => ckpt.base === "sdxl").map((ckpt) => ckpt.id);
const pdxlTemplates = checkpoints.filter((ckpt) => ckpt.base === "pdxl").map((ckpt) => ckpt.id);
// const sdxlTemplates = checkpoints.filter((ckpt) => ckpt.base === "sdxl").map((ckpt) => ckpt.id);
// const pdxlTemplates = checkpoints.filter((ckpt) => ckpt.base === "pdxl").map((ckpt) => ckpt.id);

console.log(sdxlTemplates);
console.log(pdxlTemplates);
Expand Down

0 comments on commit fe8472f

Please sign in to comment.