mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-08 02:52:12 +00:00
cleanup wip
This commit is contained in:
1 parent
4a83a87802
commit
2149876e75
4 files changed
+36
-47
No files matched your search
@@ -4,10 +4,6 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import {
|
||||
getCreatorIcon,
|
||||
Model,
|
||||
ModelConfig,
|
||||
CANVAS_2D_PAGE_MODELS,
|
||||
STAGE_3D_PAGE_MODELS,
|
||||
IMAGE_EDITOR_PAGE_MODELS,
|
||||
VIDEO_MODELS,
|
||||
IMAGE_MODELS,
|
||||
} from "@storyteller/model-list";
|
||||
@@ -17,22 +13,6 @@ export type ModelList = Omit<PopoverItem, "selected">[];
|
||||
|
||||
const withIcon = (creatorIcon: any, fallback: any) => creatorIcon || fallback;
|
||||
|
||||
const buildItems = (
|
||||
models: ModelConfig[],
|
||||
fallbackIcon: any
|
||||
) =>
|
||||
models.map((m) => ({
|
||||
label: m.label,
|
||||
icon: withIcon(getCreatorIcon(m.info.creator), fallbackIcon),
|
||||
description: m.description,
|
||||
badges: m.badges?.map((b) => ({
|
||||
label: b.label,
|
||||
icon: <FontAwesomeIcon icon={faClock} />,
|
||||
})),
|
||||
modelConfig: m, // Access to full object.
|
||||
modelInfo: m.info,
|
||||
}));
|
||||
|
||||
const buildItems2 = (
|
||||
models: Model[],
|
||||
fallbackIcon: any
|
||||
@@ -46,7 +26,6 @@ const buildItems2 = (
|
||||
icon: <FontAwesomeIcon icon={faClock} />,
|
||||
})),
|
||||
modelConfig: model.toLegacyModelConfig(), // Access to full object.
|
||||
modelInfo: undefined, // NB: Dead.
|
||||
model: model,
|
||||
}));
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ const cfg = (
|
||||
...m,
|
||||
});
|
||||
|
||||
export const ALL_MODELS: ModelConfig[] = [
|
||||
const ALL_MODELS: ModelConfig[] = [
|
||||
//////////////////////////////
|
||||
// Image models
|
||||
//////////////////////////////
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
import { ALL_MODELS_BY_ID } from "./Models.js";
|
||||
import { ModelConfig } from "./ModelConfig.js";
|
||||
import { ModelTag } from "./ModelTag.js";
|
||||
import { getModelsByCategory } from "./Models.js";
|
||||
|
||||
/**
|
||||
* We might not want to always programatically build the list of models, because
|
||||
@@ -9,28 +5,32 @@ import { getModelsByCategory } from "./Models.js";
|
||||
* more popular models. We may also want to selectively prune non-useful models.
|
||||
*/
|
||||
|
||||
export const TEXT_TO_IMAGE_PAGE_MODELS : ModelConfig[] =
|
||||
getModelsByCategory("image")
|
||||
// Remove inpainting and editing models.
|
||||
.filter((m) => m.id !== "flux_pro_inpaint")
|
||||
.filter((m) => m.id !== "flux_pro_kontext_max");
|
||||
// export const TEXT_TO_IMAGE_PAGE_MODELS : ModelConfig[] =
|
||||
// getModelsByCategory("image")
|
||||
// // Remove inpainting and editing models.
|
||||
// .filter((m) => m.id !== "flux_pro_inpaint")
|
||||
// .filter((m) => m.id !== "flux_pro_kontext_max");
|
||||
|
||||
export const IMAGE_TO_VIDEO_PAGE_MODELS : ModelConfig[] =
|
||||
getModelsByCategory("video");
|
||||
// export const IMAGE_TO_VIDEO_PAGE_MODELS : ModelConfig[] =
|
||||
// getModelsByCategory("video");
|
||||
|
||||
export const CANVAS_2D_PAGE_MODELS : ModelConfig[] =
|
||||
getModelsByCategory("image")
|
||||
// Remove non-instructive models.
|
||||
.filter((m) => m.tags?.includes(ModelTag.InstructiveEdit))
|
||||
// export const CANVAS_2D_PAGE_MODELS : ModelConfig[] =
|
||||
// getModelsByCategory("image")
|
||||
// // Remove non-instructive models.
|
||||
// .filter((m) => m.tags?.includes(ModelTag.InstructiveEdit))
|
||||
|
||||
export const STAGE_3D_PAGE_MODELS : ModelConfig[] =
|
||||
getModelsByCategory("image")
|
||||
// Remove non-instructive models.
|
||||
.filter((m) => m.tags?.includes(ModelTag.InstructiveEdit))
|
||||
// export const STAGE_3D_PAGE_MODELS : ModelConfig[] =
|
||||
// getModelsByCategory("image")
|
||||
// // Remove non-instructive models.
|
||||
// .filter((m) => m.tags?.includes(ModelTag.InstructiveEdit))
|
||||
|
||||
export const IMAGE_EDITOR_PAGE_MODELS : ModelConfig[] = [
|
||||
// Explicit list for now.
|
||||
ALL_MODELS_BY_ID.get("flux_pro_inpaint")!,
|
||||
ALL_MODELS_BY_ID.get("flux_dev_juggernaut_inpaint")!,
|
||||
ALL_MODELS_BY_ID.get("flux_pro_kontext_max")!,
|
||||
];
|
||||
// export const IMAGE_EDITOR_PAGE_MODELS : ModelConfig[] = [
|
||||
// // Explicit list for now.
|
||||
// ALL_MODELS_BY_ID.get("flux_pro_inpaint")!,
|
||||
// ALL_MODELS_BY_ID.get("flux_dev_juggernaut_inpaint")!,
|
||||
// ALL_MODELS_BY_ID.get("flux_pro_kontext_max")!,
|
||||
// ];
|
||||
|
||||
// export const CANVAS_2D_PAGE_MODELS_NEW : ImageModel[] = IMAGE_MODELS
|
||||
// // Remove non-instructive models.
|
||||
// .filter((m) => m.tags?.includes(ModelTag.InstructiveEdit))
|
||||
@@ -0,0 +1,10 @@
|
||||
import { Model } from "../classes/Model.js";
|
||||
import { ALL_MODELS_LIST } from "./AllModels.js";
|
||||
|
||||
export const ALL_MODELS_BY_ID : Map<string, Model> = new Map(
|
||||
ALL_MODELS_LIST.map((model) => [model.id, model])
|
||||
);
|
||||
|
||||
if (ALL_MODELS_BY_ID.size !== ALL_MODELS_LIST.length) {
|
||||
throw new Error("All models must have unique IDs");
|
||||
}
|
||||
Reference in new issue
Block a user