olegchomp / TDDiffusionAPI

TouchDesigner interface for AUTOMATIC1111
170 stars 6 forks source link

Different output folder #2

Closed jeremy-keenan closed 1 year ago

jeremy-keenan commented 1 year ago

Is it possible to choose a custom output folder for the generated images, either dynamically or when connecting to A1111?

olegchomp commented 1 year ago

You can change it in a1111 settings (because TDA use same directory as in a1111)

olegchomp commented 1 year ago

Or you can create chop execute and set it to "image ready trigger" with enable Off to On. Then change mainfolder path to your image folder path.

import time

def onOffToOn(channel, sampleIndex, val, prev):
    mainfolder = 'H:/SD/stable-diffusion-webui/outputs/txt2img-images'
    img_format = f".{op('TDDiffusionAPI/TdaEXT').fetch('img_format')}"
    folder = op('TDDiffusionAPI/TdaEXT').fetch('img_type')

    op('Result_Image').save(f'{mainfolder}/{folder}/{int(time.time())}{img_format}',createFolders=True,asynchronous=True)

return