aiyabot icon indicating copy to clipboard operation
aiyabot copied to clipboard

Output images are overwritten when using the same seed.

Open Gecktendo opened this issue 10 months ago • 1 comments

Describe the bug
When you generate images using the same seed, the previous copy of the image is overwritten in the output folder. This makes the bot pull the wrong image when you are trying to retrieve an upscale of previous images. For example, in these pictures, I generated a picture of an asteroid belt, then a picture of an asteroid belt in watercolor. When I tried upscaling the original, it upscaled the watercolor one.


Environment

  • OS: Windows 1 2 3

Console logs
Put any error messages that show in the console log.

Gecktendo avatar Apr 06 '24 17:04 Gecktendo

Hey, another sneaky one ahah.

For this - as it's only true when using batch>1 - we will re-use the previously commented lines about the seed, to change the epoch_time (part of the filename). To produce a new BatchID when using Edit : https://github.com/Kilvoctu/aiyabot/blob/4b3b62f3065f6d458bea328abd8fa1e0633d7a48/core/stablecog.py#L680-L684

to :

# increment epoch_time for view when using batch
if count != len(image_data):
    new_epoch = list(queue_object.view.input_tuple)
    new_epoch[20] = int(time.time())
    new_tuple = tuple(new_epoch)
    queue_object.view.input_tuple = new_tuple

NB: It's new_epoch[20] for the new version of the bot, but it's new_epoch[18] if using an old version. cf. The tuple in viewhandler : https://github.com/Kilvoctu/aiyabot/blob/4b3b62f3065f6d458bea328abd8fa1e0633d7a48/core/viewhandler.py#L37

Cheers ! 🥂

wizz13150 avatar Apr 15 '24 21:04 wizz13150

Just circling back to this, seems like there's a fix available but is there any chance this will get pushed to live?

Gecktendo avatar Jul 12 '24 06:07 Gecktendo