-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Kendal Cormany <[email protected]>
- Loading branch information
1 parent
83f30bc
commit 557c673
Showing
16 changed files
with
469 additions
and
339 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
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 |
---|---|---|
|
@@ -121,3 +121,6 @@ test-results | |
|
||
# Python venv | ||
venv/ | ||
|
||
# UV | ||
assets/uv |
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
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
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 |
---|---|---|
|
@@ -3,23 +3,26 @@ | |
"productName": "ComfyUI", | ||
"repository": "github:comfy-org/electron", | ||
"copyright": "Copyright © 2024 Comfy Org", | ||
"version": "0.2.17", | ||
"version": "0.3.0", | ||
"homepage": "https://comfy.org", | ||
"description": "The best modular GUI to run AI diffusion models.", | ||
"main": ".vite/build/main.js", | ||
"packageManager": "[email protected]", | ||
"config": { | ||
"frontendVersion": "1.3.43", | ||
"comfyVersion": "0.2.7", | ||
"managerCommit": "e629215c100c89a9a9d33fc03be3248069ff67ef" | ||
"managerCommit": "e629215c100c89a9a9d33fc03be3248069ff67ef", | ||
"uvVersion": "0.5.1" | ||
}, | ||
"scripts": { | ||
"clean": "rimraf .vite dist out", | ||
"clean:uv": "rimraf assets/uv", | ||
"clean:assets": "rimraf assets/.env assets/ComfyUI assets/python.tgz & yarn run clean:assets:dev", | ||
"clean:assets:dev": "yarn run clean:assets:git && rimraf assets/python assets/override.txt & rimraf assets/cpython*.tar.gz & rimraf assets/requirements.*", | ||
"clean:assets:git": "rimraf assets/ComfyUI/.git assets/ComfyUI/custom_nodes/ComfyUI_Manager/.git assets/ComfyUI/custom_nodes/DesktopSettingsExtension/.git", | ||
"clean:slate": "yarn run clean & yarn run clean:assets & rimraf node_modules", | ||
"clone-settings-extension": "git clone https://github.com/Comfy-Org/DesktopSettingsExtension.git assets/ComfyUI/custom_nodes/DesktopSettingsExtension", | ||
"download:uv": "node scripts/downloadUV.js", | ||
"download-frontend": "node scripts/downloadFrontend.js", | ||
"make:frontend": "yarn run download-frontend && yarn run clone-settings-extension", | ||
"format": "prettier --check .", | ||
|
This file was deleted.
Oops, something went wrong.
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,83 @@ | ||
const path = require("path"); | ||
const os = require('os'); | ||
const fs = require('fs-extra'); | ||
const axios = require('axios'); | ||
const tar = require('tar'); | ||
const extractZip = require('extract-zip'); | ||
const uvVer = require('../package.json').config.uvVersion; | ||
|
||
const options = { | ||
win32: { | ||
zipFile: 'uv-x86_64-pc-windows-msvc.zip', | ||
uvOutputFolderName: 'win', | ||
zip: true, | ||
}, | ||
darwin: { | ||
zipFile: 'uv-aarch64-apple-darwin.tar.gz', | ||
uvOutputFolderName: 'macos', | ||
zip: false, | ||
}, | ||
linux: { | ||
zipFile: 'uv-x86_64-unknown-linux-gnu.tar.gz', | ||
uvOutputFolderName: 'linux', | ||
zip: false, | ||
} | ||
} | ||
|
||
async function downloadUV() { | ||
|
||
const allFlag = process.argv[2]; | ||
const baseDownloadURL = `https://github.com/astral-sh/uv/releases/download/${uvVer}/`; | ||
if (allFlag) | ||
{ | ||
if (allFlag === 'all') { | ||
await downloadAndExtract(baseDownloadURL, options.win32); | ||
await downloadAndExtract(baseDownloadURL, options.darwin); | ||
await downloadAndExtract(baseDownloadURL, options.linux); | ||
return; | ||
} | ||
if (allFlag === 'none') { | ||
return; | ||
} | ||
} | ||
|
||
const uvDownloaded = fs.existsSync(path.join('./assets', 'uv')); | ||
if (!uvDownloaded) { | ||
await downloadAndExtract(baseDownloadURL, options[os.platform()]); | ||
return; | ||
} | ||
console.log('< UV Folder Exists, Skipping >'); | ||
|
||
}; | ||
|
||
async function downloadAndExtract(baseURL, options) { | ||
const { | ||
zipFile, | ||
uvOutputFolderName, | ||
zip | ||
} = options; | ||
const zipFilePath = path.join('./assets', zipFile); | ||
const outputUVFolder = path.join('./assets', 'uv', uvOutputFolderName); | ||
await fs.mkdir(outputUVFolder, { | ||
recursive: true | ||
}); | ||
const downloadedFile = await axios({ | ||
method: 'GET', | ||
url: baseURL + zipFile, | ||
responseType: 'arraybuffer' | ||
}); | ||
fs.writeFileSync(zipFilePath, downloadedFile.data); | ||
zip ? await extractZip(zipFilePath, { | ||
dir: path.resolve(outputUVFolder) | ||
}) : tar.extract({ | ||
sync: true, | ||
file: zipFilePath, | ||
C: outputUVFolder, | ||
"strip-components": 1 | ||
}); | ||
await fs.unlink(zipFilePath); | ||
console.log(`FINISHED DOWNLOAD AND EXTRACT UV ${uvOutputFolderName}`); | ||
} | ||
|
||
//** Download and Extract UV. Default uses OS.Platfrom. Add 'all' will download all. Add 'none' will skip */ | ||
downloadUV(); |
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
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
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
Oops, something went wrong.