Lazy Sketch
pendingby Jaroslaw Weber
Generate AI sketches directly in your notes using Replicate API.
Obsidian Lazy Sketch
Generate AI-powered sketches directly in your Obsidian notes using the Replicate API.
Demo
Watch the plugin in action:
https://github.com/user-attachments/assets/764d1cc4-0a2d-4fc6-b9ec-eb4c0f932e8d
Features
- π¨ Generate cute pencil sketch-style images with text prompts
- πΌοΈ Insert generated images directly into your notes
- β¨ Fast generation using Z-Image-Turbo model with LoRA
- βοΈ Customizable API settings
- π― Multiple prompt patterns (cute, detailed, whimsical)
- π Simple and intuitive workflow
Installation
Manual Installation
- Download the latest release from the Releases page
- Extract the downloaded zip file
- Copy the extracted folder to your Obsidian plugins directory:
- macOS:
~/.obsidian/plugins/ - Windows:
%APPDATA%/Obsidian/plugins/ - Linux:
~/.config/obsidian/plugins/
- macOS:
- Enable the plugin in Obsidian Settings β Community Plugins
Development Installation
# Clone the repository
git clone https://github.com/jaroslaw-weber/obsidian-lazy-sketch-plugin.git
cd obsidian-lazy-sketch-plugin
# Install dependencies
npm install
# Build the plugin
npm run build
# Configure your Obsidian path in .env
# OBSIDIAN_PATH=/path/to/your/vault
# Build and copy to your Obsidian plugins directory
npm run build
Setup
Required Configuration
- Get a Replicate API token at https://replicate.com/account/api-tokens
- Open Obsidian Settings β Community Plugins β Lazy Sketch
- Enter your Replicate API Token (required for the plugin to work)
- The model and LoRA weights are pre-configured for pencil sketches, but you can customize them if needed
How to Use
Method 1: Command Palette with Input
- Place your cursor where you want to insert the image
- Open Command Palette (
Cmd/Ctrl + P) - Run "Lazy Sketch: Generate Sketch"
- Enter your prompt in the popup dialog
- Click "Generate" or press Enter
- Wait for the image to generate (usually 8-10 seconds)
- The sketch will be inserted as

Method 2: Using Selected Text
- Type your prompt in your note (e.g., "A cat wearing a hat")
- Select the text
- Run "Lazy Sketch: Generate Sketch" command
- The selected text will be replaced with the generated image
Example Prompts
A cat wearing a hat
A cozy cabin in the forest
Abstract geometric shapes with vibrant colors
A futuristic space station
A simple tree with falling leaves
Understanding Prompt Patterns
The plugin supports different artistic styles:
- Cute: "a color pencil sketch. clear white background. cute & fun & simple. {prompt}"
- Detailed: "a detailed pencil sketch. clean white background. intricate & realistic. {prompt}"
- Whimsical: "a playful pencil sketch. white background. whimsical & imaginative. {prompt}"
You can customize these patterns in the plugin settings.
Generated Files
Images are automatically saved to a files/ folder in your vault with filenames like:
sketch_prompt_1234567890.jpg
The timestamp ensures each image has a unique filename.
Configuration
Replicate API Token
Required for image generation. Get your token at Replicate API Tokens.
Default Model
The Replicate model to use for generation. The default is prunaai/z-image-turbo-lora which is optimized for fast pencil sketch generation.
LoRA Weights URL
The huggingface URL for the LoRA weights that define the pencil sketch style. Default: https://huggingface.co/Ttio2/Z-Image-Turbo-pencil-sketch/blob/main/Zimage_pencil_sketch.safetensors
Prompt Patterns
Customize the prompt templates that wrap your user input. Use {prompt} as a placeholder for your actual prompt.
Development
# Install dependencies
npm install
# Development mode with hot reload
npm run dev
# Build for production (also copies to Obsidian if .env is configured)
npm run build
Project Structure
βββ src/ # Source code
β βββ main.ts # Main plugin logic
β βββ styles.css # Plugin styles
βββ scripts/ # Build scripts
β βββ copy-to-obsidian.js
βββ assets/ # Media files
β βββ lazy-sketch-demo.gif
βββ dist/ # Build output (generated)
Troubleshooting
"Please set your Replicate API token in settings"
Make sure you've entered your API token in the plugin settings. Get one at Replicate API Tokens.
Image generation is slow
The plugin uses the fast Z-Image-Turbo model which typically takes 8-10 seconds. Check the Obsidian console (Ctrl+Shift+I) for detailed status messages.
Generated images are 0 bytes
This should now be fixed in the latest version. If you still encounter this, try reinstalling the plugin.
"Error: Generation failed"
Check the Obsidian console (Ctrl+Shift+I) for detailed error messages. Common causes:
- Invalid API token
- API quota exceeded
- Network connectivity issues
- Model is temporarily unavailable
Contributing
Contributions welcome! Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
- Improve documentation
License
MIT License - see LICENSE file for details
Credits
- Built with Obsidian Plugin API
- Powered by Replicate
- Pencil sketch style using Z-Image-Turbo with LoRA
Support
For issues and feature requests, please use the GitHub Issues page.
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.