An extension of stable-diffusion-webui
As of 13.08.2024, this extension is no longer functional with the new version of Forge that uses Gradio 4+. Please note that this change may also affect AUTO1111 in the future.
However, don't despair! Canvas Zoom is likely to take on a new form. The original concept of the extension was entirely based on Gradio 3 and solving its issues, which is why the current version is incompatible with Gradio 4+.
Once Gradio 4+ is firmly established and becomes the standard, I plan to start developing a new extension project. This new project will make working with the editor even more convenient and will transfer the main beloved features from the current Canvas Zoom.
Adds the ability to zoom into Inpaint, Sketch, and Inpaint Sketch.
The extension supports webui version 1.1, 1.2,1.3
The extension is fully compatible with webui version 1.4, 1.5, 1.6 and the built-in canvas-zoom-and-pan extension. However, I still recommend that you disable the built-in.
Canvas Zoom supports integration with other popular extensions: ControlNet, Regional Prompter Latent Couple(Two Shot) and Inpaint Anything. More details here
https://github.com/richrobber2/canvas-zoom/assets/22278673/1f666443-34bc-421e-8edc-e4eaa22722a6
Webui versions earlier than March 25th are not supported
If extension does not work check the troubleshooting page https://github.com/richrobber2/canvas-zoom/wiki/Troubleshooting
You can check out the features of this extension in canvas-zoom-showcase
The extension description also available in these languages: Русский-Russian, Deutsch-German
You can edit the hotkeys as you want, to do this you need to go into the settings.
Canvas zoom works on a modified version of gradio 3.31 or 3.23 for versions below 1.1, you can read all the details in the dist folder
The hotkeys only work in the image area
Shift + wheel - Zoom canvas
Ctr + wheel - Change brush size
Ctr-Z - Undo last action
F (hold) - Move canvas
S - Fullscreen mode, zoom in on the canvas so that it fits into the screen.
R - Reset Zoom.
Q - Open/Close color panel
T - Open color panel right above the mouse.
H - Fill the entire canvas with brush color ( Works in Sketch and Inpaint Sketch )
A - Toggle dropper ( Works in Sketch and Inpaint Sketch )
O - Overlap all elements and back
C - Toggle mask transparency mode ( Works only in Inpaint )
[ - Increase brush size
] - Decrease brush size
In transparency mode, you can paint but the effect will not be what you expect, this mode is useful to see how the mask fits on the picture.
Shift + wheel (hold) - Move canvas
Shift + "+" or Shift + "-" - Scale canvas ( numpad keys also work )
You can fix the color bar wherever you want, for this purpose point the mouse on the place you want and press "T" and then every time you press "Q" the color bar will open in this place. If you click on the button in the right corner, the panel will reset and work as it should.
If you zoom in on a picture that is too wide to fit in the window, pressing "S" will magnify it to full screen width without the scroll bar.
You can add a white outline to the brush to better see its borders. You can turn it on in the settings
You can select the color of the mask in Inpaint and the color of all your lines will change to the color of the mask
In img2img in all tabs a new button "📏" has been added next to the width and height sliders. This button allows you to get the real width and height of the picture in 1 click. Removed from webui 1.3 and higher because a native solution is now available.
If you are using ControlNet, you can enable integration with the extension in the settings. After enabling it, reload the page
You can choose the default color of the mask in Inpaint, you can change the color of the mask in the settings.
In the settings you can turn off the tooltip and functionality that you do not need
You can adjust the size of the maximum size of the brush and the ability to change the % by which it is changed
If a white image appears when you cancel on the Hotkey, press the cancel hotkey again and the image will return.
This is not my bug, the problem is related to webui automatic1111. If you send a picture to Sketch or Inpaint Sketch via buttons, the undo last action on the hotkey and on the button breaks. What to avoid this problem: you can load the picture directly, via drag and drop or via copy and paste. The problem is solved in the latest update, but only works on hotkeys ( Ctr+Z )
This is not my bug, the problem is with webui automatic1111. If you draw something in Sketch, Inpaint, Inpaint Sketch and then switch to another tab, when you go back and what else you draw, undo will undo on the previous 2 actions, the last one before the switch and the last one after.
This is not my bug, the problem is with webui automatic1111. When the browser scale is more or less than 100%, Sketch and Inpaint Sketch break if you send an image to them via buttons. Change the browser and windows scale to 100% and everything will be fine.
This is not my bug, the problem is with webui automatic1111. If you don't close the image in inpaint and transfer it to inpaint again in any way, the mask remains. The problem was solved in the latest update
Thanks to everyone who supported this extension, everyone who gave ideas for this project.
Special thanks to richrobber2 for his idea, which later I (daswer123) was able to strongly develop.
I would also like to thank separately the author of popular models: Deliberate and Reliberate, the person under the nickname XpucT for supporting the project at an early stage of development.
Thanks to the AI Diffusion community on discord for support.