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 0c2c9d1
Showing
23 changed files
with
34,636 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,7 @@ | ||
[*.{js,jsx,ts,tsx,vue}] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
max_line_length = 100 |
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,120 @@ | ||
const INLINE_ELEMENTS = require('eslint-plugin-vue/lib/utils/inline-non-void-elements.json'); | ||
|
||
module.exports = { | ||
root: true, | ||
env: { | ||
node: true, | ||
}, | ||
extends: [ | ||
// https://github.com/vuejs/eslint-plugin-vue | ||
'plugin:vue/recommended', | ||
|
||
// https://github.com/vuejs/eslint-config-airbnb | ||
// https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-base | ||
'@vue/airbnb', | ||
], | ||
parserOptions: { | ||
parser: '@babel/eslint-parser', | ||
}, | ||
rules: { | ||
// [Overwrites plugin:vue/recommended] | ||
// Enforce the maximum number of attributes per line | ||
// https://eslint.vuejs.org/rules/max-attributes-per-line.html | ||
'vue/max-attributes-per-line': ['error', { | ||
singleline: {max: 5}, | ||
multiline: {max: 3}, | ||
}], | ||
|
||
// [Overwrites plugin:vue/recommended] | ||
// Require a line break before and after the contents of a singleline element | ||
// https://eslint.vuejs.org/rules/singleline-html-element-content-newline.html | ||
'vue/singleline-html-element-content-newline': ['error', { | ||
ignoreWhenNoAttributes: true, | ||
ignoreWhenEmpty: true, | ||
ignores: ['sp-label', 'sp-detail', 'sp-body', 'pre', 'textarea', ...INLINE_ELEMENTS], | ||
}], | ||
|
||
// [Overwrites Airbnb] | ||
// We need to disable standard `max-len` because it ignores `template` from `vue/max-len` | ||
'max-len': 'off', | ||
'vue/max-len': ['error', { | ||
code: 120, | ||
template: 140, // only for vue/max-len | ||
tabWidth: 2, | ||
ignorePattern: 'd="([\\s\\S]*?)"', // for svg | ||
ignoreUrls: true, | ||
ignoreComments: true, | ||
ignoreRegExpLiterals: true, | ||
ignoreTemplateLiterals: true, | ||
ignoreStrings: true, | ||
|
||
// ignoreHTMLAttributeValues: true, | ||
// ignoreHTMLTextContents: false, | ||
}], | ||
|
||
// [Overwrites Airbnb because they disabled ForInStatement and ForOfStatement] | ||
// Disallow specified syntax; Overwrites Airbnb | ||
// https://eslint.vuejs.org/rules/no-restricted-syntax | ||
// https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/style.js | ||
// https://eslint.org/docs/rules/no-restricted-syntax | ||
'no-restricted-syntax': ['error', 'LabeledStatement', 'WithStatement'], | ||
'vue/no-restricted-syntax': ['error', 'LabeledStatement', 'WithStatement'], | ||
|
||
// [Overwrites Airbnb] | ||
// Enforce consistent spacing inside braces | ||
// https://eslint.vuejs.org/rules/object-curly-spacing | ||
// https://eslint.org/docs/rules/object-curly-spacing | ||
'object-curly-spacing': ['error', 'never'], | ||
'vue/object-curly-spacing': ['error', 'always'], | ||
|
||
// [Overwrites Airbnb for properties of photoshop objects] | ||
// Disallow dangling underscores in identifiers | ||
// https://eslint.org/docs/latest/rules/no-underscore-dangle | ||
'no-underscore-dangle': ['error', {allow: ['_value', '_id']}], | ||
|
||
// [Overwrites Airbnb to disable minProperties] | ||
// Enforce consistent line breaks inside braces | ||
// https://eslint.vuejs.org/rules/object-curly-newline | ||
// https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/style.js | ||
// https://eslint.org/docs/rules/object-curly-newline | ||
'object-curly-newline': ['error', { | ||
ObjectExpression: {multiline: true, consistent: true}, | ||
ObjectPattern: {multiline: true, consistent: true}, | ||
ImportDeclaration: {multiline: true, consistent: true}, | ||
ExportDeclaration: {multiline: true, consistent: true}, | ||
}], | ||
'vue/object-curly-newline': ['error', { | ||
ObjectExpression: {multiline: true, consistent: true}, | ||
ObjectPattern: {multiline: true, consistent: true}, | ||
ImportDeclaration: {multiline: true, consistent: true}, | ||
ExportDeclaration: {multiline: true, consistent: true}, | ||
}], | ||
|
||
// [Overwrites Airbnb to enforce stroustrup style] | ||
// Require Brace Style | ||
// https://eslint.vuejs.org/rules/brace-style | ||
// https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/style.js | ||
// https://eslint.org/docs/rules/brace-style | ||
'brace-style': ['error', 'stroustrup', {allowSingleLine: true}], | ||
'vue/brace-style': ['error', 'stroustrup', {allowSingleLine: true}], | ||
|
||
// Disallow the use of console | ||
// https://eslint.org/docs/rules/no-console | ||
'no-console': process.env.NODE_ENV === 'production' ? ['error', {allow: ['warn', 'error']}] : 'off', | ||
|
||
// https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility | ||
'vuejs-accessibility/alt-text': 'off', | ||
'vuejs-accessibility/click-events-have-key-events': 'off', | ||
}, | ||
overrides: [ | ||
{ | ||
files: [ | ||
'**/__tests__/*.{j,t}s?(x)', | ||
'**/tests/unit/**/*.spec.{j,t}s?(x)', | ||
], | ||
env: { | ||
jest: true, | ||
}, | ||
}, | ||
], | ||
}; |
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,25 @@ | ||
/public/icons-old | ||
/releases | ||
|
||
.DS_Store | ||
node_modules | ||
/dist | ||
|
||
# local env files | ||
.env.local | ||
.env.*.local | ||
|
||
# Log files | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
|
||
# Editor directories and files | ||
.idea | ||
.vscode | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
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,58 @@ | ||
# Stable.art 🖼 | ||
|
||
Stable.art is an open-source plugin for Photoshop (v23.3.0+) that allows you to use Stable Diffusion (with Automatic1111 as a backend) to accelerate your art workflow. Say goodbye to tedious art processes and hello to seamless creativity with Stable.art. | ||
|
||
## How to install | ||
|
||
0. Download the CCX file. | ||
1. Open the Creative Cloud desktop app and ensure it is running and up to date. | ||
2. Make sure you have the latest version of Photoshop installed. If not, update it through the Creative Cloud desktop app. | ||
3. Open Photoshop. | ||
4. Double-click on the downloaded CCX file. | ||
5. Follow the prompts and the plugin panel should appear in Photoshop. If it does not, go to Plugins > Stable.art. | ||
|
||
### Start API server | ||
|
||
To use Stable.art you need to enable an API for your Automatic1111: | ||
|
||
* If you use Automatic1111 locally, then you need to follow this [guide](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/API). | ||
|
||
* If you want to use Google Colab, then you can use [fast-stable-diffusion](https://github.com/TheLastBen/fast-stable-diffusion). You need to edit the last cell (double-click on it) and change `Enable_API = False` to `Enable_API = True`. | ||
|
||
Lastly, enter the url of your Automatic1111 server (e.g. `http://127.0.0.1:7860`, `https://***.gradio.live`, `https://***.loca.lt`, `https://***.gradio.app`, etc) in the "Endpoint" field. | ||
|
||
## Features | ||
|
||
### Lexica.art Integration | ||
|
||
If you need help coming up with ideas or finding assistance with prompts, you can use the Lexica.art search engine right inside the plugin for inspiration. | ||
|
||
### txt2img | ||
|
||
By default, txt2img generates an image with a size of 512x512. If you want to generate an image with a specific size, you can use the rectangular marquee tool and specify any size (with any ratio!) you desire. | ||
|
||
### img2img/inpaint | ||
|
||
To use img2img/inpaint, simply select an area of your image using any selection tool. Yes, you can use any selection tool (e.g. rectangular marquee, lasso, quick selection, magic wand, or any other selection tool). Then to generate an image, simply click the "Generate" button. It is that easy - no masks or any other complicated steps are required. | ||
|
||
### outpaint | ||
|
||
Coming Soon. | ||
|
||
## Development | ||
|
||
1. Install dependencies. | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
2. Start a server to compile and hot-reload the plugin. | ||
|
||
```bash | ||
npm run serve | ||
``` | ||
|
||
3. Open Photoshop, then open "Adobe UXP Developer Tool", click "Add plugin", and select `manifest-dev.json`, which is located in the `/public` folder. Note: during development, you should only use `manifest-dev.json` because `manifest.json` (which will be located in the `/dist` folder) should be used only for final builds after running `npm run build` (and you can just ignore `manifest.json` that is located in the `/public` folder). Two manifests are required to conveniently test final builds - "UXP Developer Tool" does not support adding multiple plugins with the same ids. | ||
|
||
4. You will get the plugin with id `dev.stable.art`, click on its Actions and then click "Load". |
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,5 @@ | ||
module.exports = { | ||
presets: [ | ||
'@vue/cli-plugin-babel/preset', | ||
], | ||
}; |
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,19 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"module": "esnext", | ||
"baseUrl": "./", | ||
"moduleResolution": "node", | ||
"paths": { | ||
"@/*": [ | ||
"src/*" | ||
] | ||
}, | ||
"lib": [ | ||
"esnext", | ||
"dom", | ||
"dom.iterable", | ||
"scripthost" | ||
] | ||
} | ||
} |
Oops, something went wrong.