-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 248f397
Showing
7 changed files
with
219 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module.exports = { | ||
run: [{ | ||
method: "shell.run", | ||
params: { | ||
message: [ | ||
"git clone https://github.com/jhc13/taggui app", | ||
] | ||
} | ||
}, { | ||
method: "script.start", | ||
params: { | ||
uri: "torch.js", | ||
params: { | ||
path: "app", | ||
venv: "env", | ||
xformers: true | ||
} | ||
} | ||
}, { | ||
method: "shell.run", | ||
params: { | ||
venv: "env", | ||
path: "app", | ||
message: [ | ||
"pip install -r requirements.txt" | ||
] | ||
} | ||
},{ | ||
method: "notify", | ||
params: { | ||
html: "Click the 'start' tab to get started!" | ||
} | ||
}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
const path = require('path') | ||
module.exports = { | ||
version: "1.5", | ||
title: "Taggui", | ||
description: "Tag manager and captioner for image datasets: https://github.com/jhc13/taggui", | ||
icon: "icon.png", | ||
menu: async (kernel) => { | ||
let installing = await kernel.running(__dirname, "install.js") | ||
let installed = await kernel.exists(__dirname, "app", "env") | ||
let running = await kernel.running(__dirname, "start.js") | ||
if (installing) { | ||
return [{ | ||
icon: "fa-solid fa-plug", | ||
text: "Installing", | ||
href: "install.js", | ||
}] | ||
} else if (installed) { | ||
if (running) { | ||
let local = kernel.memory.local[path.resolve(__dirname, "start.js")] | ||
if (local && local.url) { | ||
return [{ | ||
icon: "fa-solid fa-rocket", | ||
text: "Open Web UI", | ||
href: local.url, | ||
}, { | ||
icon: 'fa-solid fa-terminal', | ||
text: "Terminal", | ||
href: "start.js", | ||
}] | ||
} else { | ||
return [{ | ||
icon: 'fa-solid fa-terminal', | ||
text: "Terminal", | ||
href: "start.js", | ||
}] | ||
} | ||
} else { | ||
return [{ | ||
icon: "fa-solid fa-power-off", | ||
text: "Start", | ||
href: "start.js", | ||
}, { | ||
icon: "fa-solid fa-plug", | ||
text: "Update", | ||
href: "update.js", | ||
}, { | ||
icon: "fa-solid fa-plug", | ||
text: "Install", | ||
href: "install.js", | ||
}, { | ||
icon: "fa-regular fa-circle-xmark", | ||
text: "Reset", | ||
href: "reset.js", | ||
}] | ||
} | ||
} else { | ||
return [{ | ||
icon: "fa-solid fa-plug", | ||
text: "Install", | ||
href: "install.js", | ||
}] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
run: [{ | ||
method: "fs.rm", | ||
params: { | ||
path: "app" | ||
} | ||
}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module.exports = { | ||
daemon: true, | ||
run: [{ | ||
method: "shell.run", | ||
params: { | ||
path: "app", | ||
venv: "env", | ||
env: { }, | ||
message: [ | ||
"python taggui/run_gui.py", | ||
], | ||
on: [{ "event": "/http:\/\/[0-9.:]+/", "done": true }] | ||
} | ||
}, { | ||
method: "local.set", | ||
params: { | ||
url: "{{input.event[0]}}" | ||
} | ||
}, { | ||
method: "proxy.start", | ||
params: { | ||
uri: "{{local.url}}", | ||
name: "Local Sharing" | ||
} | ||
}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
module.exports = { | ||
run: [ | ||
{ | ||
"when": "{{platform === 'win32' && gpu === 'nvidia'}}", | ||
"method": "shell.run", | ||
"params": { | ||
"venv": "{{args && args.venv ? args.venv : null}}", | ||
"path": "{{args && args.path ? args.path : '.'}}", | ||
"message": "pip install torch torchvision torchaudio {{args && args.xformers ? 'xformers' : ''}} --index-url https://download.pytorch.org/whl/cu121" | ||
} | ||
}, | ||
// windows amd | ||
{ | ||
"when": "{{platform === 'win32' && gpu === 'amd'}}", | ||
"method": "shell.run", | ||
"params": { | ||
"venv": "{{args && args.venv ? args.venv : null}}", | ||
"path": "{{args && args.path ? args.path : '.'}}", | ||
"message": "pip install torch-directml" | ||
} | ||
}, | ||
// windows cpu | ||
{ | ||
"when": "{{platform === 'win32' && (gpu !== 'nvidia' && gpu !== 'amd')}}", | ||
"method": "shell.run", | ||
"params": { | ||
"venv": "{{args && args.venv ? args.venv : null}}", | ||
"path": "{{args && args.path ? args.path : '.'}}", | ||
"message": "pip install torch torchvision torchaudio" | ||
} | ||
}, | ||
// mac | ||
{ | ||
"when": "{{platform === 'darwin'}}", | ||
"method": "shell.run", | ||
"params": { | ||
"venv": "{{args && args.venv ? args.venv : null}}", | ||
"path": "{{args && args.path ? args.path : '.'}}", | ||
"message": "pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu" | ||
} | ||
}, | ||
// linux nvidia | ||
{ | ||
"when": "{{platform === 'linux' && gpu === 'nvidia'}}", | ||
"method": "shell.run", | ||
"params": { | ||
"venv": "{{args && args.venv ? args.venv : null}}", | ||
"path": "{{args && args.path ? args.path : '.'}}", | ||
"message": "pip install torch torchvision torchaudio {{args && args.xformers ? 'xformers' : ''}}" | ||
} | ||
}, | ||
// linux rocm (amd) | ||
{ | ||
"when": "{{platform === 'linux' && gpu === 'amd'}}", | ||
"method": "shell.run", | ||
"params": { | ||
"venv": "{{args && args.venv ? args.venv : null}}", | ||
"path": "{{args && args.path ? args.path : '.'}}", | ||
"message": "pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm5.7" | ||
} | ||
}, | ||
// linux cpu | ||
{ | ||
"when": "{{platform === 'linux' && (gpu !== 'amd' && gpu !=='amd')}}", | ||
"method": "shell.run", | ||
"params": { | ||
"venv": "{{args && args.venv ? args.venv : null}}", | ||
"path": "{{args && args.path ? args.path : '.'}}", | ||
"message": "pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
run: [{ | ||
method: "shell.run", | ||
params: { | ||
message: "git pull" | ||
} | ||
}, { | ||
method: "shell.run", | ||
params: { | ||
path: "app", | ||
message: "git pull" | ||
} | ||
}] | ||
} |