Skip to content

Grease Pencil

Carson Katri edited this page Apr 8, 2023 · 3 revisions

Project File: grease_pencil.blend

Note This project requires the following models:

  • runwayml/stable-diffusion-v1-5
  • lllyasviel/sd-controlnet-scribble

Creating Scribbles

Use Grease Pencil to draw a black and white sketch.

The Viewport Shading panel can be used to set the background color to white.

Once you have a sketch, we can create our node setup.

Using Viewport Color

To get the content of our sketch, we'll use the Viewport Color node. This node outputs an image that looks exactly like what can be seen from the 3D Viewport editor.

Warning A 3D Viewport editor must be open for this node to succeed. Otherwise, the render will fail.

Scribble ControlNet

The model lllyasviel/sd-controlnet-scribble lets you control Stable Diffusion with simple sketches. Add a ControlNet node. Change the source from Collection to Image.

We'll invert the color of the sketch because the ControlNet model expects images with a black background and white foreground. Use a Math node set to Subtract and set the A value to 1 and the B value to the output of the Viewport Color node.

Connect the inverted image to the ControlNet, and the ControlNet to the Stable Diffusion node.

When the scene is rendered, we get an oil painting look from our simple sketch.