Skip to content

Commit

Permalink
Merge branch 'master' into comfyui
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdullahAlfaraj committed Oct 11, 2023
2 parents 7f2f723 + 75814b0 commit 56a70af
Show file tree
Hide file tree
Showing 69 changed files with 3,327 additions and 51,242 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: publish ccx and make tag

on:
workflow_dispatch:
inputs:
tag_name:
description: 'tag name'
required: true

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Create Release Asset
shell: bash
run: |
cd $GITHUB_WORKSPACE
npm i
npm run publish
node build-script/pack-ccx.mjs --version ${{ github.event.inputs.tag_name }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.event.inputs.tag_name }}
release_name: v${{ github.event.inputs.tag_name }}
draft: true
prerelease: false

- name: Upload ZIP
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Auto.Photoshop.SD.plugin_v${{ github.event.inputs.tag_name }}.zip
asset_name: Auto.Photoshop.SD.plugin_v${{ github.event.inputs.tag_name }}.zip
asset_content_type: application/zip

- name: Upload CCX
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Auto.Photoshop.SD.plugin_v${{ github.event.inputs.tag_name }}.ccx
asset_name: Auto.Photoshop.SD.plugin_v${{ github.event.inputs.tag_name }}.ccx
asset_content_type: application/zip
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ experimental/
start_server.sh
start_server.bat
*.ccx
*.zip
expanded_mask.png
original_mask.png
/config
Expand Down
80 changes: 52 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ By supporting us on [Patreon](https://www.patreon.com/AbdullahAlfaraj), you’ll
<td><a href="https://ronnykhalil.com/"><img src="https://images.weserv.nl/?url=https://raw.githubusercontent.com/AbdullahAlfaraj/Auto-Photoshop-StableDiffusion-Plugin/206b56c911f67ede3ca3a934d0bce8c1d68a2113/docs/profile_image/A934E4F0-7778-47E9-A395-531BFF2E61F1_1_105_c.jpeg&h=80&w=80&fit=cover&mask=circle&maxage=7d" alt="Ronny Khalil"></a></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=zachary" alt="zachary"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Razvan+Matei" alt="Razvan Matei"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=MasterAI" alt="MasterAI"></td>
</tr>
<tr>
<td><a href="https://ronnykhalil.com/">Ronny Khalil</a></td>
<td>zachary</td>
<td>Razvan Matei</td>
<td>MasterAI</td>
</tr>
</table>

Expand All @@ -56,32 +58,58 @@ By supporting us on [Patreon](https://www.patreon.com/AbdullahAlfaraj), you’ll
<tr>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Alex+" alt="Alex "></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Olivier+Lefebvre" alt="Olivier Lefebvre"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Arthur+Liu" alt="Arthur Liu"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Florin-Alexandru+Ilinescu" alt="Florin-Alexandru Ilinescu"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Zenko+" alt="Zenko "></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Juan+Pablo+Mendiola" alt="Juan Pablo Mendiola"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Robin+Edwards" alt="Robin Edwards"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Frederic+Dreuilhe" alt="Frederic Dreuilhe"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Danny+Sahagun" alt="Danny Sahagun"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=darius+coal" alt="darius coal"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Kerwin" alt="Kerwin"></td>
</tr>
<tr>
<td>Alex </td>
<td>Olivier Lefebvre</td>
<td>Arthur Liu</td>
<td>Florin-Alexandru Ilinescu</td>
<td>Zenko </td>
<td>Juan Pablo Mendiola</td>
<td>Robin Edwards</td>
<td>Frederic Dreuilhe</td>
<td>Danny Sahagun</td>
<td>darius coal</td>
<td>Kerwin</td>
</tr>
<tr>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Danny+Sahagun" alt="Danny Sahagun"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=darius+coal" alt="darius coal"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Kerwin" alt="Kerwin"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=The+Dread+Vixen+Alinsa" alt="The Dread Vixen Alinsa"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Bruce+Hunter" alt="Bruce Hunter"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Chris+Canterbury" alt="Chris Canterbury"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Lawrence+L+Tran" alt="Lawrence L Tran"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Jake+Skokan" alt="Jake Skokan"></td>
</tr>
<tr>
<td>Danny Sahagun</td>
<td>darius coal</td>
<td>Kerwin</td>
<td>The Dread Vixen Alinsa</td>
<td>Bruce Hunter</td>
<td>Chris Canterbury</td>
<td>Lawrence L Tran</td>
<td>Jake Skokan</td>
</tr>
<tr>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=que0005" alt="que0005"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Xavier+Matia+Bernasconi" alt="Xavier Matia Bernasconi"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Mats+Oldin" alt="Mats Oldin"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Rodrigo+Terra" alt="Rodrigo Terra"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Nicolas+Meunier" alt="Nicolas Meunier"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Ihor+Pankin" alt="Ihor Pankin"></td>
</tr>
<tr>
<td>que0005</td>
<td>Xavier Matia Bernasconi</td>
<td>Mats Oldin</td>
<td>Rodrigo Terra</td>
<td>Nicolas Meunier</td>
<td>Ihor Pankin</td>
</tr>
</table>

Expand All @@ -91,39 +119,27 @@ By supporting us on [Patreon](https://www.patreon.com/AbdullahAlfaraj), you’ll
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Amith+Thomas" alt="Amith Thomas"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=xiao+yuan" alt="xiao yuan"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Ezra+Blake" alt="Ezra Blake"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Arthur+Liu" alt="Arthur Liu"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Zenko+" alt="Zenko "></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Juan+Pablo+Mendiola" alt="Juan Pablo Mendiola"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Kevin+Schofield" alt="Kevin Schofield"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Mvs+Srs" alt="Mvs Srs"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Felipe+Cortes" alt="Felipe Cortes"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Smith" alt="Smith"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Sanchez" alt="Sanchez"></td>
</tr>
<tr>
<td>Amith Thomas</td>
<td>xiao yuan</td>
<td>Ezra Blake</td>
<td>Arthur Liu</td>
<td>Zenko </td>
<td>Juan Pablo Mendiola</td>
<td>Kevin Schofield</td>
<td>Mvs Srs</td>
<td>Felipe Cortes</td>
<td>Smith</td>
<td>Sanchez</td>
</tr>
<tr>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Lawrence+L+Tran" alt="Lawrence L Tran"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Felipe+Cortes" alt="Felipe Cortes"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Smith" alt="Smith"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Jake+Skokan" alt="Jake Skokan"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=que0005" alt="que0005"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Xavier+Matia+Bernasconi" alt="Xavier Matia Bernasconi"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Mats+Oldin" alt="Mats Oldin"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Ziui+Witter" alt="Ziui Witter"></td>
</tr>
<tr>
<td>Lawrence L Tran</td>
<td>Felipe Cortes</td>
<td>Smith</td>
<td>Jake Skokan</td>
<td>que0005</td>
<td>Xavier Matia Bernasconi</td>
<td>Mats Oldin</td>
<td>Ziui Witter</td>
</tr>
</table>

Expand All @@ -132,12 +148,18 @@ By supporting us on [Patreon](https://www.patreon.com/AbdullahAlfaraj), you’ll
<tr>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Sebastian+Karbowniczek" alt="Sebastian Karbowniczek"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Petter+Lundh" alt="Petter Lundh"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Aftyr+byrn" alt="Aftyr byrn"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=AWWalker" alt="AWWalker"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=cdmusic" alt="cdmusic"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=Jason+Bessonette" alt="Jason Bessonette"></td>
<td><img src="https://ui-avatars.com/api/?background=random&color=fff&rounded=true&name=22two+" alt="22two "></td>
</tr>
<tr>
<td>Sebastian Karbowniczek</td>
<td>Petter Lundh</td>
<td>Aftyr byrn</td>
<td>AWWalker</td>
<td>cdmusic</td>
<td>Jason Bessonette</td>
<td>22two </td>
</tr>
</table>

Expand All @@ -158,6 +180,8 @@ By supporting us on [Patreon](https://www.patreon.com/AbdullahAlfaraj), you’ll





<a href="https://www.patreon.com/AbdullahAlfaraj" rel="nofollow"><img src="docs/become_backer.svg" style="max-width: 100%;"></a>


Expand Down
75 changes: 75 additions & 0 deletions build-script/pack-ccx.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import chalk from 'chalk'
import { program } from 'commander'
import { createWriteStream, readFileSync, statSync, writeFileSync } from 'fs'
import { globSync } from 'glob'
import { dirname, join, relative } from 'path'
import { fileURLToPath } from 'url'
import yazl from 'yazl'

const __dirname = dirname(fileURLToPath(import.meta.url))
const basePath = join(__dirname, '..')

program.requiredOption('--version <platform>', 'the target platform').parse()

const version = program.opts().version
if (!version.match(/\d+\.\d+\.\d+/))
throw new Error(`invalid version format: ${version}`)

console.log(chalk.cyan("rewriting manifest.json's version field to " + version))
const manifest = JSON.parse(readFileSync(`${basePath}/manifest.json`, 'utf-8'))
manifest.version = version
writeFileSync(`${basePath}/manifest.json`, JSON.stringify(manifest))

console.log(chalk.cyan("rewriting package.json's version field to " + version))
const packageJSON = JSON.parse(
readFileSync(`${basePath}/package.json`, 'utf-8')
)
packageJSON.version = version
writeFileSync(`${basePath}/package.json`, JSON.stringify(packageJSON))

console.log(chalk.cyan('packaging .ccx'))
const zipList = [
'./manifest.json',
'./i18n/**/*',
'./icon/**/*',
'./jimp/**/*',
'./scripts/**/*',
'./typescripts/dist/**/*',
'./utility/**/*',
'./server/**/*',
'./*.js',
'./package.json',
'./tsconfig.json',
'./*.html',
'./*.py',
'./*.txt',
'./*.md',
'./*.png',
'./presets/**/*',
]

const zipfile = new yazl.ZipFile()

zipList.forEach((globber) => {
globSync(join(basePath, globber).replace(/\\/g, '/')).forEach(
(filepath) => {
if (statSync(filepath).isDirectory()) return

const rpath = relative(basePath, filepath)
zipfile.addFile(filepath, rpath)
}
)
})

zipfile.outputStream.pipe(
createWriteStream(
join(basePath, `Auto.Photoshop.SD.plugin_v${version}.ccx`)
)
)
zipfile.outputStream.pipe(
createWriteStream(
join(basePath, `Auto.Photoshop.SD.plugin_v${version}.zip`)
)
)

zipfile.end()
11 changes: 6 additions & 5 deletions webpack.config.js → build-script/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ const CopyPlugin = require('copy-webpack-plugin')

module.exports = {
entry: {
bundle: './typescripts/entry.ts',
bundle: path.resolve(__dirname, '../typescripts/entry.ts'),
},
output: {
path: path.resolve(__dirname, './typescripts/dist'),
path: path.resolve(__dirname, '../typescripts/dist'),
filename: '[name].js',
libraryTarget: 'commonjs2',
},
mode: 'development',
// mode: 'production',
devtool: 'inline-source-map', // won't work on XD due to lack of eval
// devtool: 'source-map',

devtool: false,

externals: {
uxp: 'commonjs2 uxp',
photoshop: 'commonjs2 photoshop',
Expand All @@ -35,7 +36,7 @@ module.exports = {
loader: 'ts-loader',
exclude: /node_modules/,
options: {
configFile: 'tsconfig.json',
configFile: path.resolve(__dirname, '../typescripts/tsconfig.json'),
},
},
{
Expand Down
5 changes: 5 additions & 0 deletions icon/search_button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 56a70af

Please sign in to comment.