|
| 1 | +# Image Metadata Editor Forge |
| 2 | + |
| 3 | +A simple & user-friendly extension for Stable Diffusion WebUI Forge that lets you view, edit, add & manage metadata in your AI-generated images. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +This extension helps you: |
| 10 | +- **View metadata** stored inside your AI-generated images (like prompts, settings, etc.) |
| 11 | +- **Edit existing metadata** or add new info to images |
| 12 | +- **Save images** w/ updated metadata |
| 13 | +- **Remove all metadata** from images if needed |
| 14 | +- **Add custom info** like artist name, notes, or categories |
| 15 | + |
| 16 | +Think of metadata as invisible info stored inside your image files - like the recipe used to create the AI image. |
| 17 | + |
| 18 | +## Installation (Step-by-Step) |
| 19 | + |
| 20 | +### For Complete Beginners: |
| 21 | + |
| 22 | +1. **Find your Forge folder**: `stable-diffusion-webui-forge` on your computer |
| 23 | + |
| 24 | +2. **Navigate to extensions**: Inside that folder, find & open the `extensions` folder |
| 25 | + |
| 26 | +3. **Download this extension**: |
| 27 | + - **Easy way**: Download as ZIP from [release page](), extract it, & put the folder in `extensions` |
| 28 | + - **Git way** (if you have Git installed): Open command prompt/terminal in the extensions folder & run: |
| 29 | + ``` |
| 30 | + git clone https://github.com/MackinationsAi/sd-forge-metadata-editor.git |
| 31 | + ``` |
| 32 | +
|
| 33 | +4. **Restart Forge**: Close Stable Diffusion WebUI Forge completely & start it again |
| 34 | +
|
| 35 | +5. **Find the extension**: Look for "Image Metadata Editor" section in your txt2img or img2img tabs (it will be collapsed/closed by default - click to open it) |
| 36 | +
|
| 37 | +### Basic Workflow |
| 38 | +
|
| 39 | +#### 1. **Upload an Image** |
| 40 | +- Click the "Source" image upload area |
| 41 | +- Select any image file (PNG, JPEG, etc.) |
| 42 | +- Metadata is automatically read & displayed |
| 43 | +
|
| 44 | +#### 2. **View Existing Metadata** |
| 45 | +The extension automatically displays: |
| 46 | +- **Generation Info Tab**: Shows parsed metadata in readable format |
| 47 | +- **Nothing found in the image** = No metadata detected |
| 48 | +- **Parsed parameters** = Shows prompt, negative prompt, steps, etc. |
| 49 | +
|
| 50 | +#### 3. **Edit Parameters** |
| 51 | +In the "Generation Info" tab, you can edit: |
| 52 | +- **Prompt**: Main generation prompt |
| 53 | +- **Negative Prompt**: Negative prompt text |
| 54 | +- **Steps**: Number of sampling steps (1-150) |
| 55 | +- **CFG Scale**: Classifier guidance scale (1.0-30.0) |
| 56 | +- **Sampler**: Sampling method (e.g., "DPM++ 2M") |
| 57 | +- **Schedule type**: Sampling schedule (e.g., "Karras") |
| 58 | +- **Model**: Model name used |
| 59 | +- **Seed**: Generation seed (-1 for random) |
| 60 | +- **Size-1 & Size-2**: Image dimensions (width x height) |
| 61 | +
|
| 62 | +#### 4. **Add Custom Metadata** (Optional) |
| 63 | +In the "Custom Fields" tab: |
| 64 | +
|
| 65 | +**Method A - Using Add Button:** |
| 66 | +1. Enter a key (e.g., "artist") |
| 67 | +2. Enter a value (e.g., "MyUsername") |
| 68 | +3. Click "Add" button |
| 69 | +4. The key-value pair is added to the image’s metadata JSON |
| 70 | +
|
| 71 | +**Method B - Direct JSON Editing:** |
| 72 | +1. Edit the JSON directly in the text area: |
| 73 | + ```json |
| 74 | + { |
| 75 | + "artist": "MyUsername", |
| 76 | + "category": "portrait", |
| 77 | + "rating": "5", |
| 78 | + "notes": "My favorite generation" |
| 79 | + } |
| 80 | + ``` |
| 81 | + |
| 82 | +#### 5. **Save Your Image** |
| 83 | +- Click **"Save w/ Metadata"** |
| 84 | +- The image appears in "Output Image" tab |
| 85 | +- Success message shows: "✅ Successfully saved metadata to image!" |
| 86 | +- Go to the Output Image tab to download the image |
| 87 | + |
| 88 | +### Advanced Features |
| 89 | + |
| 90 | +#### **Raw Metadata Tab** |
| 91 | +- View complete metadata as JSON |
| 92 | +- Manually edit any metadata field |
| 93 | +- See exactly what's stored in the image |
| 94 | +- Useful for debugging or advanced editing |
| 95 | + |
| 96 | +#### **Clear Metadata** |
| 97 | +- Click "Clear Metadata" to remove ALL metadata |
| 98 | +- Useful for creating clean images for sharing |
| 99 | +- Cannot be undone, so save original first |
| 100 | + |
| 101 | +## Troubleshooting |
| 102 | + |
| 103 | +### "Nothing found in the image" |
| 104 | +- This means your image has no metadata (completely normal for photos or edited images) |
| 105 | +- You can still add metadata & save it w/ that new info |
| 106 | + |
| 107 | +### Extension Not Showing Up |
| 108 | +1. Make sure the files are in the right place: `extensions/sd-forge-metadata-editor/scripts/metadata_editor.py` |
| 109 | +2. Restart Forge completely (close & reopen) |
| 110 | +3. Check the console for error messages |
| 111 | + |
| 112 | +### Can't Save Images |
| 113 | +- Make sure you have permission to write files where Forge is installed |
| 114 | +- Try w/ a simple prompt first |
| 115 | +- Check if your antivirus is blocking file creation |
| 116 | + |
| 117 | +### Custom Fields Not Working |
| 118 | +- Make sure your JSON format is correct (the extension will show errors) |
| 119 | +- Use simple text w/o special characters when starting out |
| 120 | + |
| 121 | +## FAQ |
| 122 | + |
| 123 | +**Q: Will this work w/ images from other AI tools?** |
| 124 | +A: Yes, if they save metadata in standard formats. You can also add metadata to any image. |
| 125 | + |
| 126 | +**Q: Can I use this to organize my image collection?** |
| 127 | +A: Yes! Add custom fields like "category", "rating", or "notes" to help organize your images. |
| 128 | + |
| 129 | +**Q: Does this change my original image?** |
| 130 | +A: No, it creates a new copy w/ the metadata. Your original stays unchanged. So you have to download the new image w/ metadata to see the changes. |
| 131 | + |
| 132 | +**Q: Why save as PNG instead of JPEG?** |
| 133 | +A: PNG preserves metadata much better than JPEG, ensuring your info doesn't get lost. |
| 134 | + |
| 135 | +## How It Works |
| 136 | + |
| 137 | +### Compatibility |
| 138 | +- ✅ **Stable Diffusion WebUI Forge**: Primary target platform |
| 139 | +- ✅ **AUTOMATIC1111**: Can read A1111 metadata format |
| 140 | +- ✅ **Other SD Tools**: Standard metadata format ensures compatibility |
| 141 | + |
| 142 | +### File Structure |
| 143 | +``` |
| 144 | +sd-forge-metadata-editor/ |
| 145 | +├── README.md # This documentation |
| 146 | +├── assets/ |
| 147 | +| ├── ui.png # UI Example |
| 148 | +| └── input_test_image.png # Input Image Example |
| 149 | +└── scripts/ |
| 150 | + └── metadata_editor.py # Main extension code |
| 151 | +``` |
| 152 | + |
| 153 | +1. **Reading**: Uses `images.read_info_from_image()` (same as Forge's PNG Info tab) |
| 154 | +2. **Parsing**: Extracts individual parameters from metadata strings |
| 155 | +3. **Editing**: Provides user-friendly form inputs for common parameters |
| 156 | +4. **Custom Fields**: JSON-based storage for additional metadata |
| 157 | +5. **Saving**: Embeds metadata as PNG text chunks for maximum compatibility |
| 158 | + |
| 159 | +### Adding Metadata to Raw Image |
| 160 | +1. Upload a photo or image w/ or w/o metadata |
| 161 | +2. Fill in Generation Info fields: |
| 162 | + - Prompt: "beautiful landscape, mountains" |
| 163 | + - Steps: 20 |
| 164 | + - CFG Scale: 7.0 |
| 165 | + - Sampler: "DPM++ 2M" |
| 166 | +3. Add custom fields: |
| 167 | + ```json |
| 168 | + {"source": "original photo", "edited": "2024"} |
| 169 | + ``` |
| 170 | +4. Click "Save w/ Metadata" |
| 171 | + |
| 172 | +### Can Read Metadata From: |
| 173 | +- PNG files w/ embedded metadata |
| 174 | +- JPEG files w/ EXIF data |
| 175 | +- Images created by Stable Diffusion, AUTOMATIC1111, Forge & ComfyUI |
| 176 | + |
| 177 | +### Supported Formats |
| 178 | +- Can read metadata from: PNG (text), JPEG (EXIF), SD formats (Forge, A1111, ComfyUI) |
| 179 | +- Saves as: PNG (best for preserving metadata) |
| 180 | + |
| 181 | +## Contributing |
| 182 | + |
| 183 | +This extension is open source. Feel free to: |
| 184 | +- Report bugs or issues |
| 185 | +- Suggest new features |
| 186 | +- Submit pull requests |
| 187 | +- Share usage examples |
| 188 | + |
| 189 | +## License |
| 190 | + |
| 191 | +This extension is available under the MIT License. |
| 192 | + |
| 193 | +--- |
| 194 | + |
| 195 | +**Version**: 1.0 |
| 196 | +**Author**: MackinationsAi |
| 197 | +**Compatibility**: Stable Diffusion WebUI Forge |
| 198 | +**Last Updated**: May 2025 |
0 commit comments