attempt to package comfyui

This commit is contained in:
kaj
2023-07-12 10:56:31 -08:00
parent 158ccf298b
commit e0f787c4d7
7 changed files with 50 additions and 12 deletions

2
.gitignore vendored
View File

@@ -11,3 +11,5 @@ node_modules
!.yarn/releases
!.yarn/sdks
!.yarn/versions
**/src-tauri/comfyui/*

View File

@@ -27,6 +27,7 @@
"@tanstack/react-query": "^4.22.0",
"@tanstack/react-query-devtools": "^4.22.0",
"@tanstack/react-virtual": "beta",
"@tauri-apps/api": "^1.4.0",
"buffer": "^6.0.3",
"date-fns": "^2.29.3",
"file-saver": "^2.0.5",

View File

@@ -17,7 +17,7 @@ tauri-build = { version = "1.4.0", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.4.0", features = [] }
tauri = { version = "1.4.0", features = [ "fs-all", "path-all"] }
[features]
# this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled.

View File

@@ -2,7 +2,7 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
fn main() {
tauri::Builder::default()
.run(tauri::generate_context!())
.expect("error while running tauri application");
tauri::Builder::default()
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

View File

@@ -11,11 +11,17 @@
},
"tauri": {
"allowlist": {
"all": false
"fs": {
"scope": ["$RESOURCE/*", "$RESOURCE/comfyui/*"],
"all": true
},
"path": {
"all": true
}
},
"bundle": {
"active": true,
"category": "DeveloperTool",
"category": "GraphicsAndDesign",
"copyright": "",
"deb": {
"depends": []
@@ -28,7 +34,7 @@
"icons/icon.icns",
"icons/icon.ico"
],
"identifier": "com.tauri.dev",
"identifier": "com.stabilityai.stablestudio",
"longDescription": "",
"macOS": {
"entitlements": null,
@@ -37,13 +43,22 @@
"providerShortName": null,
"signingIdentity": null
},
"resources": [],
"resources": [
"comfyui/*"
],
"shortDescription": "",
"targets": "all",
"targets": [
"app",
"nsis",
"deb"
],
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": ""
"timestampUrl": "",
"wix": {
"language": "en-US"
}
}
},
"security": {
@@ -55,10 +70,10 @@
"windows": [
{
"fullscreen": false,
"height": 600,
"height": 950,
"resizable": true,
"title": "StableStudio",
"width": 800
"width": 1800
}
]
}

View File

@@ -1,9 +1,21 @@
import { readTextFile } from "@tauri-apps/api/fs";
import { resolveResource } from "@tauri-apps/api/path";
// alternatively, use `window.__TAURI__.path.resolveResource`
// alternatively, use `window.__TAURI__.fs.readTextFile`
import ReactDOM from "react-dom/client";
import "~/GlobalVariables";
import { App } from "~/App";
(async () => {
const resourcePath = await resolveResource(
"comfyui/README_VERY_IMPORTANT.txt"
);
console.log(resourcePath, await readTextFile(resourcePath));
})();
const main = async () => {
const root = document.getElementById("app");
root &&

View File

@@ -1278,6 +1278,7 @@ __metadata:
"@tanstack/react-query": ^4.22.0
"@tanstack/react-query-devtools": ^4.22.0
"@tanstack/react-virtual": beta
"@tauri-apps/api": ^1.4.0
"@types/file-saver": ^2.0.5
"@types/lodash.throttle": ^4.1.7
"@types/react": ^18.0.27
@@ -1427,6 +1428,13 @@ __metadata:
languageName: node
linkType: hard
"@tauri-apps/api@npm:^1.4.0":
version: 1.4.0
resolution: "@tauri-apps/api@npm:1.4.0"
checksum: 0c24b72d6bdb1180aafc6a19bdaad1501810f880f1a52f0fbe1b1b2b04fe0b6148deba7a3769a03b877e4ddf3008348b6e1c6cb725f17effb78c9a0a0e099dc5
languageName: node
linkType: hard
"@tootallnate/once@npm:2":
version: 2.0.0
resolution: "@tootallnate/once@npm:2.0.0"