Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add diffusionkit to local-apps #875

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
41 changes: 41 additions & 0 deletions packages/tasks/src/local-apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,39 @@ const snippetLocalAI = (model: ModelData, filepath?: string): LocalAppSnippet[]
];
};

const snippetDiffusionKit = (model: ModelData): LocalAppSnippet[] => {
const command = (binary: string) =>
[
"# Load and run the model:",
`${binary} \\`,
` --model-version ${model.id}" \\`,
' --prompt "a futuristic cityscape" \\',
` --height 768 \\`,
` --width 1360 \\`,
` --seed 1001 \\`,
` --step ${model.tags.includes("flux") ? 4 : 50} \\`,
` --cfg ${model.tags.includes("flux") ? 0. : 5} \\`,
` --output ~/Desktop/out.png`,
].join("\n");
return [
{
title: "Install from pip",
setup: "pip install diffusionkit",
content: command("diffusionkit-cli"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if binary is always the same mayber simpler to hardcode it a const command = string

},
{
title: "Build from source code",
setup: [
// prettier-ignore
"git clone https://github.com/argmaxinc/DiffusionKit.git",
"cd DiffusionKit",
"pip install -e .",
].join("\n"),
content: command("diffusionkit-cli"),
},
];
};

/**
* Add your new local app here.
*
Expand Down Expand Up @@ -239,6 +272,14 @@ export const LOCAL_APPS = {
displayOnModelPage: (model) => model.library_name === "diffusers" && model.pipeline_tag === "text-to-image",
deeplink: (model) => new URL(`https://diffusionbee.com/huggingface_import?model_id=${model.id}`),
},
diffusionkit: {
prettyLabel: "DiffusionKit",
docsUrl: "https://github.com/argmaxinc/DiffusionKit",
mainTask: "text-to-image",
macOSOnly: true,
displayOnModelPage: (model) => model.library_name === "diffusionkit" && model.pipeline_tag === "text-to-image",
snippet: snippetDiffusionKit,
},
joyfusion: {
prettyLabel: "JoyFusion",
docsUrl: "https://joyfusion.app",
Expand Down
Loading