Skip to content

Plugin for interfacing Grasshopper to the Automatic1111 API

License

Notifications You must be signed in to change notification settings

dkeners/AutoVisualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoVisualizer

About

AutoVisualizer is a plugin designed for Grasshopper, providing seamless integration with the Automatic1111 Stable Diffusion API. This powerful combination enables users to generate captivating images directly within the Grasshopper environment, harnessing the capabilities of the Automatic1111 API for stable diffusion processes.

Static Badge GitHub Release Date - Published_At GitHub last commit (branch)

Static Badge Static Badge Static Badge

GenerateASync

Main Components

1. SD_GenerateASync

Can generate an image asynchronously given a prompt and negative prompt, with extra options if needed. Generate button to start another iteration.

2. SD_GenerateSettings*

A group of four components offering varying levels of control over final generation settings.

3. CaptureViewport

A way to capture the current active viewport, used with ControlNetRequest for influence.

4. ControlNetRequest

Allows for the user to make a control net instance based off a reference image and settings.

Installation

Dependencies

  1. Install Automatic1111 locally.
    1. If using ControlNet components install ControlNet for Automatic1111
  2. Run the new install of Automatic1111 in API mode with one of the methods below:
    1. Run Automatic1111 from command line with the argument --api
    2. Create a new script webui-api.bat
    @echo off
    
    set PYTHON=
    set GIT=
    set VENV_DIR=
    set COMMANDLINE_ARGS= --medvram --api
    
    git pull
    
    call webui.bat

AutoVisualizer

AutoVisualizer can be installed by going to Releases and downloading the version you would like.

  1. In Grasshopper go to File->Special Folders->Components Folder
  2. Unzip the AutoVisualizer-X-X-X.zip assembly to the Grasshopper Plugin folder

Usage

Usage will be updated when more developement has passed. For now check out the Component\ComponentTests.gh file for some examples of each component.

Configuration

The one important configuration is the IP that the API is located at. Please take note of this and modify the code, or set your IP in Automatic1111 to be 127.0.0.1:7860.

Troubleshooting

  • If no images are generated check the following:
    • Make sure that Automatic1111 is running with the --api argument.
    • Check the IP that Automatic1111 is running on, default is http://127.0.0.1:7860, if it is different update it using the Address component.
  • If ControlNet is not working check the following:
    • Make sure ControlNet is installed, check the version is "2" using the future component ControlNet_Version.
    • Make sure ControlNet models are downloaded.
  • Currently both prompt and negative prompt need inputs to run.

License

See LICENSE for details.

Acknowledgments

Big shoutout to @ParametricCamp for their Youtube tutorial series on creating grasshopper components and asynchronous requests. Ladybug devs for their imageviewer component, which provided inspiration for the one included in this plugin, as well as the BitmapPlus plugin by @interopxyz.

Feedback & Contributing

Feel free to provide feedback, suggestions, or report issues. Please reach out about contributing.

Change Log

See CHANGELOG.md for a detailed history of changes.