Overview
The VS Code integration brings AI-powered image generation directly into your development environment. Generate diagrams, documentation images, and visual assets without leaving your code editor.
Key Features
- Command Palette Integration: Generate images with
Ctrl+Shift+Pcommands - Context Menu Actions: Right-click to generate images from selected text
- Live Preview: Preview generated images in a side panel
- File Integration: Save images directly to your project
- Multi-language Support: Works with all programming languages
How It Works
- Install the Extension: Search for "PowerAI" in the VS Code marketplace
- Authenticate: Sign in with your PowerAI account
- Select Text: Highlight text or use commands to generate images
- Customize Output: Adjust settings for size, format, and style
- Save and Use: Save images to your project or copy to clipboard
Use Cases
- Documentation: Generate diagrams and illustrations for README files
- Architecture Diagrams: Create visual representations of system architecture
- API Documentation: Generate sequence diagrams and flowcharts
- Blog Posts: Create featured images and illustrations
- Presentations: Generate visuals for technical presentations
Setup Instructions
To set up the VS Code integration:
- Open VS Code and go to Extensions
- Search for "PowerAI" and click Install
- Reload VS Code when prompted
- Sign in with your PowerAI account
- Configure your preferred settings in the extension options
- Start generating images with commands or context menu
Technical Details
- Extension Version: v2.5.0
- VS Code Support: VS Code 1.70 and above
- API Integration: RESTful API with WebSocket support
- Supported Formats: PNG, JPG, SVG, WebP
- Max Resolution: Up to 4096x4096 pixels
- Processing Time: 2-10 seconds depending on complexity
Commands
PowerAI: Generate Image- Generate an image from a promptPowerAI: Generate from Selection- Generate from selected textPowerAI: Generate Diagram- Generate a diagram typePowerAI: Open Preview- Open the image preview panelPowerAI: Save Image- Save the current image to filePowerAI: Copy to Clipboard- Copy image to clipboard
Context Menu Options
Right-click on selected text to access:
- Generate Image: Create an image based on selection
- Generate Diagram: Create a diagram from selection
- Generate Icon: Create an icon from selection
- Generate Screenshot: Generate a mockup screenshot
Settings
Configure the extension in VS Code Settings:
{
"powerai.apiKey": "your-api-key",
"powerai.defaultWidth": 1920,
"powerai.defaultHeight": 1080,
"powerai.defaultFormat": "png",
"powerai.autoSave": true,
"powerai.saveLocation": "./images"
}
Keyboard Shortcuts
Ctrl+Shift+P→ "PowerAI: Generate Image" - Quick generateCtrl+Shift+G- Generate from selectionCtrl+Shift+D- Open preview panelCtrl+Shift+S- Save current image
Pricing
VS Code extension is free to install. Image generation uses your PowerAI quota. Pro plans include advanced features like batch generation and custom templates.