Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Feedjer authored Apr 20, 2024
0 parents commit 248f397
Show file tree
Hide file tree
Showing 7 changed files with 219 additions and 0 deletions.
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions install.js
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!"
}
}]
}
64 changes: 64 additions & 0 deletions pinokio.js
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",
}]
}
}
}
8 changes: 8 additions & 0 deletions reset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
run: [{
method: "fs.rm",
params: {
path: "app"
}
}]
}
26 changes: 26 additions & 0 deletions start.js
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"
}
}]
}
73 changes: 73 additions & 0 deletions torch.js
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"
}
}
]
}
14 changes: 14 additions & 0 deletions update.js
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"
}
}]
}

0 comments on commit 248f397

Please sign in to comment.