mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
10.91k stars 893 forks source link

Add AIBooru AI metadata #3505

Closed taskhawk closed 1 year ago

taskhawk commented 1 year ago

Currently there are posts that include AI metadata associated with the generated image, but that info is not available when saving the metadata with a postprocessor. Could it be added?

The AI metadata appears below the images if available. Examples:

https://aibooru.online/posts/13958 https://aibooru.online/posts/13959 https://aibooru.online/posts/13964

mikf commented 1 year ago

With the changes from https://github.com/mikf/gallery-dl/commit/c87bd1a75242b8a09e35a14351e43354696dd9f5, you can set metadata to "ai_metadata" to get this data:

$ gallery-dl -j -o metadata=ai_metadata https://aibooru.online/posts/13964
...
      "ai_metadata": {
        "cfg_scale": 7.0,
        "created_at": "2023-01-07T01:39:59.092-05:00",
        "id": 8555,
        "model_hash": "6569e224",
        "negative_prompt": "lowres, ((bad_anatomy)), ((bad_hands)), text, missing_finger, extra_digits, fewer_digits, blurry, ((mutated hands and fingers)), (poorly drawn face), ((mutation)), ((deformed_face)), (ugly), ((bad_proportions)), ((extra_limbs)), extra_face, (double_head), (extra_head), ((extra_feet)), monster, logo, cropped, worst_quality, low_quality, normal_quality, jpeg, humpbacked, long_body, long_neck, ((jpeg artifacts)), (((large_breasts, gigantic_breasts))) (((loli, teenager))), censored, mosaic",
        "post_id": 13964,
        "prompt": "(masterpiece, best quality, highres, 4k), (dress_shirt:1.5), dutch_angle, cowboy_shot, mature_female, headphones, naughty_face, curvy, bob_cut, , 2girls, side_ponytail, in a field of colorful flowers, partially_unbuttoned:1.4, glossy_lips, lipstick, from_side, blush, floating_hair, yuri, rose",
        "sampler": "Euler a",
        "seed": 3461375888,
        "steps": 20,
        "updated_at": "2023-01-07T01:39:59.092-05:00"
      },