https://github.com/AbdullahAlfaraj/Auto-Photoshop-StableDiffusion-Plugin Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + For + Enterprise + Teams + Startups + Education + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} AbdullahAlfaraj / Auto-Photoshop-StableDiffusion-Plugin Public * Notifications * Fork 112 * Star 1.8k A user-friendly plug-in that makes it easy to generate stable diffusion images inside Photoshop using Automatic1111-sd-webui as a backend. License MIT license 1.8k stars 112 forks Star Notifications * Code * Issues 32 * Pull requests 5 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights AbdullahAlfaraj/Auto-Photoshop-StableDiffusion-Plugin This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 43 branches 0 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/A] Use Git or checkout with SVN using the web URL. [gh repo clone Abdull] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @AbdullahAlfaraj AbdullahAlfaraj use the old install instructions if you are a dev ... 490f78b Mar 6, 2023 use the old install instructions if you are a dev 490f78b Git stats * 703 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github/workflows Update wiki-sync-action.yml February 6, 2023 09:31 docs wiki update - inpainting and outpainting tutorials February 4, 2023 15:38 icon add link width and height slider svg button February 18, 2023 21:12 jimp/browser/lib Merge branch 'silent_export' into master February 15, 2023 14:50 scripts reuse the code in the serverMain.py in the auto extension February 6, 2023 16:13 server/python_server convert the output of ControlNet api to a standard response the plugi... February 21, 2023 21:33 utility increment version to v1.2.0 March 5, 2023 10:58 .gitignore ignore jimp.js February 15, 2023 14:51 .prettierignore apply formatting to the code base January 30, 2023 02:00 .prettierrc fix prettier formatting January 31, 2023 07:34 LICENSE.md Create LICENSE.md December 21, 2022 15:23 README.md use the old install instructions if you are a dev March 6, 2023 09:44 dialog_box.js fix prettier formatting January 31, 2023 07:34 enum.js Merge branch 'master' of https://github.com/AbdullahAlfaraj/ Auto-Phot... February 25, 2023 07:38 helper.js Merge branch 'master' of https://github.com/AbdullahAlfaraj/ Auto-Phot... February 10, 2023 19:58 index.html store control net mask March 1, 2023 01:43 index.js increment version to v1.2.0 March 5, 2023 10:58 install.py switch back to master branch February 14, 2023 13:13 manifest.json add support to prompt shortcut in txt2img mode February 3, 2023 13:52 outpaint.js keep the original white mark layer off February 25, 2023 04:54 output_image.png add base64 image data to layer functions January 31, 2023 10:26 package-lock.json add jimp broswerify module February 15, 2023 07:03 package.json add jimp broswerify module February 15, 2023 07:03 psapi.js execute a single command March 3, 2023 19:12 requirements.txt adding duckduckgo_search dependency January 23, 2023 03:10 sdapi_py_re.js store control net mask March 1, 2023 01:43 selection.js move the selection methods to selection.js February 27, 2023 04:33 start_server.bat increment version to v1.0.8 December 26, 2022 20:46 start_server.sh Update start_server.sh December 31, 2022 17:36 start_sesrver_MacOS.sh create individual entrypoint for MacOS February 2, 2023 03:54 thumbnail.js add ability to await async callback functions February 22, 2023 16:36 update_plugin.bat added a simple way to update the plugin. December 21, 2022 06:03 update_plugin.sh add auto update to .sh script December 27, 2022 08:11 viewer.js clean mask related layers when after canceling the generation February 24, 2023 08:28 View code [ ] Auto-Photoshop-StableDiffusion-Plugin Table of Contents One Click Installer Demo: How to install Video Tutorial: Instructional Tutorial (outpaint, inpaint, img2img and txt2img): How to install (Instruction for Developers): First time running the plugin (local Automatic1111): First time running the plugin (remote Automatic1111): Steps to run the plugin for second time and onward: How to Use the Plugin: How to Videos: Quick test: txt2Img: img2img: inpaint: outpaint: prompt shortcut: Rule of thumbs: FAQ and Known Issues What Photoshop version do I need to run the plugin? Path Doesn't Exist Plugin Load Failed No application are connected to the service Load command failed in App with ID PS and Version X.X.X Exception in ASGI application / Expecting value: line 1 column 1 No Generations and Plugin Server doesn't send messages. (Remote setup) Issues with img2img, inpaint or outpaint: No GPU Options: Stable Horde Colab: README.md Auto-Photoshop-StableDiffusion-Plugin discord badge With Auto-Photoshop-StableDiffusion-Plugin, you can directly use the capabilities of Automatic1111 Stable Diffusion in Photoshop without switching between programs. This allows you to easily use Stable Diffusion AI in a familiar environment. You can edit your Stable Diffusion image with all your favorite tools and save it right in Photoshop. Table of Contents * Auto-Photoshop-StableDiffusion-Plugin * Table of Contents * Demo: * One Click Installer * How To Install Video Tutorial * Instructional Tutorial (outpaint, inpaint, img2img and txt2img): * How to install (Developers): + First time running the plugin (local Automatic1111): + First time running the plugin (remote Automatic1111): + Steps to run the plugin for second time and onward: * How to Use the Plugin: + How to Videos: + Quick test: + txt2Img: + img2img: + inpaint: + outpaint: + prompt shortcut: + Rule of thumbs: * FAQ and Known Issues + What Photoshop version do I need to run the plugin? + Path Doesn't Exist + Plugin Load Failed o No application are connected to the service o Load command failed in App with ID PS and Version X.X.X + Exception in ASGI application / Expecting value: line 1 column 1 + No Generations and Plugin Server doesn't send messages. (Remote setup) + Issues with img2img, inpaint or outpaint: * No GPU Options + Stable Horde + Colab One Click Installer Download the .ccx file and run it. that's all. you will be able to use all of stable diffusion modes (txt2img, img2img, inpainting and outpainting), check the tutorials section to master the tool. install_plugin_1 for advance/professional users who want to use the smart masking mode, we have an optional and free automatic extension that you can install, and Here is how to do it: 1. copy Auto-Photoshop plugin url copy_githup_url_2 2. paste the url in auto1111's extension tab and click install install_extension_3 3. make sure the Auto-Photoshop plugin is listed, then click "Apply and Restart UI" apply_and_restart_4 Demo: Click Here to Watch Demo How to install Video Tutorial: we recommend you use the one click installer. However watch the video on left if you don't have Automatic1111 Stable Diffusion installed, and the video on the right by Vladimir Chopine for clear instruction on how to install the plugin using UXP. [217941315-] [6874747073] Instructional Tutorial (outpaint, inpaint, img2img and txt2img): we recommend you check the tutorials section to master the tool. Click Here to Watch Tutorial How to install (Instruction for Developers): for normal users we recommend you use the one click installer First time running the plugin (local Automatic1111): 1. download the plugin: git clone https://github.com/AbdullahAlfaraj/Auto-Photoshop-StableDiffusion-Plugin.git 2. run "start_server.bat" inside "Auto-Photoshop-StableDiffusion-Plugin" directory 3. go to where you have automatic1111 installed. Edit the "webui-user.bat" in automatic1111 change this line set COMMANDLINE_ARGS= to set COMMANDLINE_ARGS= --api that will allow the plugin to communicate with the automatic1111 project. After saving close the "webui-user.bat" file and run it normally. 4. run photoshop. go to edit -> prefrences -> plugins 1. make sure you check "Enable Developer Mode" checkbox 5. install "Adobe UXP Developer Tool" from here Installation (adobe.com) this tool will add the plugin into photoshop 6. run Adobe UXP Developer Tool and click on "Add Plugin" button in the top right. Navigate to where you have "Auto-Photoshop-StableDiffusion-Plugin" folder and open "manifest.json" 7. select the plugin and click on Actions -> Load Selected that's it. First time running the plugin (remote Automatic1111): The remote webui must also have --api set in COMMANDLINE_ARGS. You can check if api access is enabled by appending "/docs#" to the end of the url. If the documentation includes /sdapi/v1/samplers then api access is enabled. 1. download the plugin: git clone https://github.com/AbdullahAlfaraj/Auto-Photoshop-StableDiffusion-Plugin.git 1. edit start_server.bat (or start_server.sh if on linux) to point to the remote installation of Automatic1111 2. run "start_server.bat" inside "Auto-Photoshop-StableDiffusion-Plugin" directory 3. run photoshop. go to edit -> prefrences -> plugins 1. make sure you check "Enable Developer Mode" checkbox 4. install "Adobe UXP Developer Tool" from here Installation (adobe.com) this tool will add the plugin into photoshop 5. run Adobe UXP Developer Tool and click on "Add Plugin" button in the top right. Navigate to where you have "Auto-Photoshop-StableDiffusion-Plugin" folder and open "manifest.json" 6. select the plugin and click on Actions -> Load Selected that's it. Steps to run the plugin for second time and onward: 1. start "webui-user.bat" 2. start "start_server.bat" 3. start "Photoshop" 4. start " Adobe UXP Developer Tool" and load the plugin How to Use the Plugin: watch this video for an in-depth, how to use the auto-photoshop-sd plugin! made by NIHIL Project How to Videos: Click Here to Watch Tutorial Quick test: 1. In photoshop, start a new project. 2. After loading the plugin, don't select or change anything. Just click on the "Generate" button 3. If you see an image of a cat get loaded onto the canvas, then everything is set up correctly. If you have an issue even after reading the following section. Please consider starting a new issue and/or join us on our discord for real-time feedback. txt2Img: 1. use the rectangular marquee tool and select square (1x1 ratio) 1. in the selection tool you can set the ratio to something like 512x512 or 512x768 2. just make sure the ratio of selection is equal to the size of the image you are generating. 2. Write a prompt and click "Generate". 3. The result will be resized to fit the selected area. But don't worry, the image will be loaded into photoshop as a smart object. So you can resize it without losing quality. img2img: 1. Select an image that is on its own layer. 1. Optional: "Ctrl + click" the layer thumbnail. If you want the generated image to be place perfectly on the Initial image. 2. Change the mode to "img2img" in the plugin UI. 3. Click on "Set Init Image" button. If the image doesn't change to the selected layer. Click multiple times. (I'm fixing this problem) 4. Click on generate inpaint: 1. Change the plugin mode to inpaint 2. Create a square selection on top of an image you want to inpaint: 1. through the rectangular marquee tool 2. or through "ctrl+click" the layer thumbnail 3. Create a new layer and paint white within the selected area. Note that anything white will be regenerated by Stable Diffusion. 4. Click "Init Inpaint Mask" button. 1. Before clicking make sure you are still on the white layer 2. after clicking the plugin will generate an appropriate black and white mask and set it as the mask to be used by Stable Diffusion. 3. It will also create a snapshot of the canvas under the selected area, and will use this snapshot as the init image. 5. Click the "Generate" button. outpaint: 1. change the plugin mode to inpaint. Remember, outpainting is just a special case of inpainting. 2. Create a "rectangular selction" that intersect with an image you want to extend. 3. Click on "Init Outpaint Mask" this will : 1. create a snapshot of the canvas under your selection and use it as "init image" for Stable Diffusion 2. create a black and white mask and will use it as the "init mask" 3. it will update both the "init image" and the "init mask" in plugin UI prompt shortcut: you can substitute a whole sequance of words with one word. Instead of writing the following as a prompt : Unreal Engine, Octane Render, arcane card game ui, hearthstone art style, epic fantasy style art you could write: {game_like} as long as you have defined the relationsip in the prompt library tab { "game_like": "Unreal Engine, Octane Render, arcane card game ui, hearthstone art style, epic fantasy style art" } Rule of thumbs: * To get the best result for inpainting and outpainting you must select the "stable-diffusion inpainting model" * An "init image" of img2img must not have transparency in it. * Always check the "init image" and the "init mask" in plugin UI and make sure they match the layers on the canvas. To fix a mismatch, do: + Select the "group_mask" in the layers panel and click on "set init mask" button. + Select the "group_init_image" in the layers panel and click on "set init image" button. * After selecting a model, you may need to wait for it to be loaded in Stable Diffusion before you should hit Generate. * Check the progress bar if it's stuck at 0% or 1%: You could always cancel/interrupt the request if you think it's taking too long and regenerated again. * Don't open multiple photoshop documents. For now, this will break the plugin. Only work on one project at a time. FAQ and Known Issues What Photoshop version do I need to run the plugin? The minimum Photoshop version that the plugin supports is Photoshop v24 Path Doesn't Exist If you get "path doesn't exist" error messeage when running start_server.bat you will need to add python to your system path. Another option is to point to python useing fullpath as shown here: replace this line in start_server.bat: python -m venv server_env find the path for python on your machine and replace the upove line something like this: C:\Users\abdul\AppData\Local\Programs\Python\Python310\python.exe -m venv server_env Plugin Load Failed There are a few issues that can result in this error, please follow the instructions for the corresponding error message in the UDT logs No application are connected to the service This error occurs when Photoshop is not started before the plugin is attempted to be loaded. Simply start photoshop then restart UXP and load the plugin Load command failed in App with ID PS and Version X.X.X This error occurs when the version of Photoshop is mistmatched with the expected version of the plugin. This may be solved by editing the manifest.json file on line 8 to match your version of Photoshop. "host": [ { "app": "PS", "minVersion": "24.0.0" } ], However, if you later upgraded your Photoshop to v24 or higher. you may need to change minVersion back to "minVersion": "24.0.0" for the plugin to function correctly. Exception in ASGI application / Expecting value: line 1 column 1 This error occurs due to mismatched expectations between the plugin and the Automatic1111 backend. It can be solved by both updating the version of the Automatic111 backend to the latest verion, and making sure "Save text information about generation parameters as chunks to png files" setting is enabled within the UI. No Generations and Plugin Server doesn't send messages. (Remote setup) This error occurs when the remote server does not have the api enabled. You can verify this by attempting to go to the URL you access the webui at and appending "/docs#" to the end of the url. If you have permissions, make relaunch the remote instance with the "--api" flag. Issues with img2img, inpaint or outpaint: img2img, inpaint and outpaint use photoshop "quick export as png" feature under the hood. At random quick export as png will break, this is a known photoshop bug. To test if the feature is broken and is the cause of your issue, do the following: select a layer and right click on it, then select quick export as png. if you get prompted with a windows, then the quick export works fine. However if nothing happen then you will need to restart photoshop and try the export feature again, until it works. if it work then you could procced to use the plugin. until you get it to work the img2img, inpaint and outpaint will not function correctly. No GPU Options: we provide two options to use the auto-photoshp plugin without GPU. Stable Horde This is an awesome free crowdsourced distributed cluster of Stable Diffusion workers. If you like this service, consider joining the horde yourself! the horde is enabled completely by the generosity of volunteers so make sure you don't overwhelm the service and help join the cause if can. read more on their github page Colab: we link to this Colab directly inside plugin find it in the settings tab. you only need to run it. no need to change any of the settings. copy the gradio.live url the colab will generate and paste it into sd url field in the settings tab. About A user-friendly plug-in that makes it easy to generate stable diffusion images inside Photoshop using Automatic1111-sd-webui as a backend. Topics art plugin ai photoshop ai-art stable-diffusion automatic1111 Resources Readme License MIT license Stars 1.8k stars Watchers 30 watching Forks 112 forks Releases No releases published Packages 0 No packages published Contributors 8 * @AbdullahAlfaraj * @adunato * @Kyxsune * @puplakto * @sphuff * @megachomba * @Infinitay * @eltociear Languages * JavaScript 79.3% * HTML 14.7% * Python 5.6% * Other 0.4% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.