Automatic1111 Integration
Located in Scripts/Runtime/Automatic/
Connects to an Automatic1111 Stable Diffusion WebUI server to generate images from text prompts.
Key Scripts
| Script | Purpose |
|--------|---------|
| AutomaticGenerator.cs | Base class with progress tracking and server communication. |
| AutomaticText2Image.cs | Generate images from text prompts. |
| AutomaticImage2Image.cs | Transform existing images with prompts. |
| AutomaticText2Material.cs | Generate PBR materials from text. |
| AutomaticConfiguration.cs | Server profiles and global settings. |
| AutomaticSettings.cs | Per-profile generation defaults. |
Basic Usage
public AutomaticText2Image automaticGenerator;
// Configure the prompt
automaticGenerator.prompt = "fantasy warrior portrait, detailed, dramatic lighting";
automaticGenerator.negativePrompt = "blurry, low quality";
automaticGenerator.width = 512;
automaticGenerator.height = 512;
automaticGenerator.steps = 30;
// Subscribe to completion event
automaticGenerator.OnImageGenerated.AddListener(OnPortraitGenerated);
// Generate
automaticGenerator.Generate();
void OnPortraitGenerated(Texture2D texture) {
portraitImage.texture = texture;
}
Configuration
| Setting | Description |
|---------|-------------|
| Server URL | Your Automatic1111 WebUI server address |
| Sampler | e.g. Euler a, DPM++ 2M |
| Model | Select from models on your SD server (use "List Models" button) |
| Steps | Diffusion steps — higher = better quality, slower |
| CFG Scale | Prompt adherence (7–12 typical) |
| Seed | -1 for random, or set a specific seed for reproducibility |
| Width / Height | Image dimensions (128–2048, must be multiples of 8) |
--api flag enabled. Start it with: ./webui.sh --apiServer Profiles
Use AutomaticConfiguration to manage multiple server profiles:
- Local development server —
http://localhost:7860 - Remote production server — Your hosted SD instance
- Different model configurations — Separate profiles for different LoRAs/checkpoints
Image Generation Capabilities
| Feature | Script | Description |
|---------|--------|-------------|
| Text to Image | AutomaticText2Image.cs | Generate images from text prompts |
| Image to Image | AutomaticImage2Image.cs | Transform existing images with AI |
| Text to Material | AutomaticText2Material.cs | Generate PBR materials for 3D objects |