ADD: Latest Forge support
install
・For Stable Diffusion WebUI or Forge
Click the Extensions tab, then click the Install from URL inner tab. Paste the repository URL below and click Install.
https://github.com/new-sankaku/stable-diffusion-webui-metadata-marker.git
・When downloading directly:
Unzip the downloaded zip file to the "extensions" folder of WebUI.
Explanation of Extensions
Images create files starting with the name "metadata_" in the "txt2img-images" folder.
Draw generation information and system information on the output image.
The generation time is about 1 second shorter than the number of seconds displayed on the Web UI, so please treat it as a reference.
Also, you can add any text.
This extension is effective when it is troublesome to open an image file as a text file. I think it is useful when pasting images to Twitter or Discord, which deletes the generation information in the image file.
Any text may include information such as copyright.
The generated information to be drawn is as follows.
Prompt, Nefative Prompt, Steps, Sampler, CFG scale, Seed, Size ,Model, Model hash
The drawing is the following 6 patterns.
Overlay, Overlay Center on the image.
Create margins on either the top, bottom, left, or right.
You can change the following when drawing:
Font, font size, font color, background color, background color opacity, arbitrary text.
If there is a feature you would like to add, please request it.
I will respond if possible.
ーー
急用の際はこちらにどうぞ。
https://twitter.com/hypersankaku2
インストール
・Stable Diffusion WebUIの場合
[拡張機能] タブをクリックし、 [URL からインストール] 内部タブをクリックします。 以下のリポジトリの URL を貼り付け、「インストール」をクリックします。
https://github.com/new-sankaku/stable-diffusion-webui-metadata-marker.git
・直接ダウンロードする場合:
ダウンロードしたZipファイルをWebUIの「extensions」フォルダに解凍します。
Extensionの説明
画像は"txt2img-images"フォルダに”metadata_”という名前から始まるファイルを作成します。
出力する画像に生成情報、システム情報を描画します。
生成時間はWeb UIで表示される秒数より1秒程度短いので、参考程度に扱ってください。
また、任意のテキストを追加できます。
画像ファイルをテキストファイルとして開くのがめんどくさい場合、このExtensionは有効です。画像ファイル内の生成情報を削除してしまうTwitterやDiscordに画像を貼り付ける場合、役に立つと思います。
任意のテキストにコピーライトのような情報を含めても良いでしょう。
描画される生成情報は以下です。
Prompt, Nefative Prompt, Steps, Sampler, CFG scale, Seed, Size ,Model, Model hash
描画は以下の6パターンです。
画像にOverlay, Overlay Centerします。
上下左右のいずれかに余白を作ります。
描画時に以下を変更できます。
フォント、フォントサイズ、フォント色、背景色、背景色不透明度、任意のテキスト。
追加したい機能があればリクエストしてください。
私に可能であれば対応します。
Description
Added font selection functionality
FAQ
Comments (21)
Can i ask how to change the font ?
There is a comment Function to get font path based on OS in scripts/metadata_marker.py in the downloaded zip.
You can change the font settings here.
If you're not confident about the changes, I'll implement a font selection when I get home, so please wait for the new version.
@new_sankaku thanks, cause my font hurt my eyes so much =))
@cx03 Added font selection in Ver1.3. Please use it if you like!
Now it work. Its in outputs/txt2img_images, the name beginn with metadata....
There is a Metadata Marker at the bottom of the txt2img. Is output image enabled in it checked? OFF by default. Or is there an error message on the command line after image generation?
yes i do all what is describe, and font size 12
max_line_length:85
text_width:510
text_height:67
x1:0
y1:0
x2:510
y2:67
@Stevem61 If the coordinates are output, just draw the image at the end.
Something seems to be happening there.
It's unnatural that no error is issued, but version 1.3 added the installation of required libraries.
Please try it once with Version1.3.
I hope it gets resolved...
If it doesn't work, I would like a normal generated image if possible.
Since the generation information is stored in the PNG file, I will check it. By the way, is your OS Windows?
@new_sankaku I use windows 11 and chrome. it's also strange that the picture doesn't get bigger when i select below instead of overlay.
@Stevem61 Metadata Marker duplicates the original image and draws a string. So, if the creation of Metadata Image fails, only the original image will be saved. If only one image is saved, I think the creation of the Metadata Image failed. However, an error may occur...
Another possibility is that the Metadata Image should be saved in the text2img-images folder. However, it may be stored in another folder.
The file name to be saved is prefixed with "metadata_" as shown below.
metadata_20230517002815987596.png
Although the possibility is low, if you search your PC with the string "metadata_", it may be saved somewhere.
@new_sankaku THAT'S IT, thanks to the "Everything" program I found the images in the "outputs/txt2img_images" folder. you should mention this in your description. it worked from the start. Now I've tried a few things: it's a pity that no parameters are saved in the generated image. If you place the text on the side, it would be good if it didn't create such a large window. And a line break in the middle of a word could also be avoided. If you create several images at once, it also works. I notice that the text frame on oberlay is a little less wide than the image. If the text is underneath, you don't notice it, although the commando output says text_width: 720 for an image with 768, for example. Or 505 instead of 512. I measured it and these 7 px are missing on the right side.
All in all your script is a great thing. :-)
@Stevem61 I mentioned that it will be saved in txt2img_images. The problem of line breaks in the middle of words has been fixed in 1.4. I think the small overlay text frame has also been resolved.
The problem of parameters not being saved in the image will be addressed in due course. We are aware of the problem that the margins on the side of the text are too large, but we are considering the specification. This will also be supported.
I'm glad the image was generated successfully in the end! Thanks for the review too!
@new_sankaku I also noticed the following: after the word "model" there is one space too many. It would also be helpful if you could see the fonts when choosing. And saving the setting would also be good. Thanks for your work.
@Stevem61 thank you! I will fix the problem with too many spaces in the next version.
I will do my best in the next version regarding fonts!
The save function is about the following... Please let me know if you still have any questions! Thank you for your review!
@new_sankaku Wonderful, it just keeps getting better. only one thing doesn't fit: Seed is suddenly displayed with -1. that wasn't before.
Most likely not possible, as I haven't seen it tracked elsewhere, but:
Elapsed processing time? IE, how long it took to produce the image.
You may not be able to get the exact elapsed time, but you should be able to get a fairly accurate value. I'll let you know if I find any other interesting information.
@new_sankaku That'd be fantastic. Whatever level of precision, it'd be welcome. Perhaps also / instead (either), it/s?
Other idea to have as an option for the metadata: state of the x/y/z script.
@fdsfds OK! It will take some time, but I will try to implement it.
Elapsed time is wonderful, thanks!
New request =) Ability to add the text to the base image, instead of the extra 'metadata' image. Or: have the png metadata also be in the 'metadata' image.
The goal would be to have only one image, with the text, -and- with png metadata. Doable?
Even if not, thanks! This is a fantastic tool.