Skip to content

Latest commit

 

History

History
75 lines (42 loc) · 3.56 KB

shark_sd_blender.md

File metadata and controls

75 lines (42 loc) · 3.56 KB

Overview

This document is intended to provide a starting point for using SHARK stable diffusion with Blender.

We currently make use of the AI-Render Plugin to integrate with Blender.

Setup SHARK and prerequisites:

  • Download the latest SHARK SD webui .exe from here or follow instructions on the README
  • Once you have the .exe where you would like SHARK to install, run the .exe from terminal/PowerShell with the --api flag:
## Run the .exe in API mode:
.\shark_sd_<date>_<ver>.exe --api

## For example:
.\shark_sd_20230411_671.exe --api --server_port=8082

## From a the base directory of a source clone of SHARK:
./setup_venv.ps1
python apps\stable_diffusion\web\index.py --api

Your local SD server should start and look something like this: image

  • Note: When running in api mode with --api, the .exe will not function as a webUI. Thus, the address in the terminal output will only be useful for API requests.

Install AI Render

  • Get AI Render on Blender Market or Gumroad
  • Open Blender, then go to Edit > Preferences > Add-ons > Install and then find the zip file
  • We will be using the Automatic1111 SD backend for the AI-Render plugin. Follow instructions here to setup local SD backend.

Your AI-Render preferences should be configured as shown; the highlighted part should match your terminal output: image

The AI-Render README has more details on installation and usage, as well as video tutorials.

Using AI-Render + SHARK in your Blender project

  • In the Render Properties tab, in the AI-Render dropdown, enable AI-Render.

image

  • Select an image size (it's usually better to upscale later than go high on the img2img resolution here.)

image

  • From here, you can enter a prompt and configure img2img Stable Diffusion parameters, and AI-Render will run SHARK SD img2img on the rendered scene.
  • AI-Render has useful presets for aesthetic styles, so you should be able to keep your subject prompt simple and focus on creating a decent Blender scene to start from.

image

Examples:

Scene (Input image):

blender-sample-2

Prompt: "A bowl of tangerines in front of rocks, masterpiece, oil on canvas, by Georgia O'Keefe, trending on artstation, landscape painting by Caspar David Friedrich"

Negative Prompt (default): "ugly, bad art, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, blurry, bad anatomy, blurred, watermark, grainy, tiling, signature, cut off, draft"

Example output:

blender-sample-2_out