09-09-2024, 06:26 AM
Thanks for this pointer, I managed to get chatgpt to write what I wanted as a result.
Im sharing this below in case anyone else finds it useful. Obviously change the paths, and this is based on excluding any XL models as Im sticking to 1.5 currently for animatediff.
-- Define the folder where your models are stored
modelFolder = "E:/Models/Stable-diffusion/"
-- Get the current scene name (without path)
sceneName = getFilenameFile(maxFileName)
-- Get all .safetensors files in the folder, excluding those containing "XL"
models = getFiles (modelFolder + "*.safetensors")
filteredModels = for m in models where (findString m "XL" == undefined) collect m
-- Loop through each filtered model file
for m in filteredModels do (
-- Extract just the model filename
modelName = getFilenameFile(m) + ".safetensors"
-- Set the current model in tyDiffusion
tyDiffusion_setString "generateModel" modelName
-- Trigger the generation process (replace with actual function if needed)
tyDiffusion_generate()
-- Define the save path using the E:/GeneratedImages directory, including scene name
savePath = "E:/GeneratedImages/" + sceneName + "_" + modelName + ".png"
-- Save the output image from viewport 0
tyDiffusion_saveImage 0 savePath
)
Im sharing this below in case anyone else finds it useful. Obviously change the paths, and this is based on excluding any XL models as Im sticking to 1.5 currently for animatediff.
-- Define the folder where your models are stored
modelFolder = "E:/Models/Stable-diffusion/"
-- Get the current scene name (without path)
sceneName = getFilenameFile(maxFileName)
-- Get all .safetensors files in the folder, excluding those containing "XL"
models = getFiles (modelFolder + "*.safetensors")
filteredModels = for m in models where (findString m "XL" == undefined) collect m
-- Loop through each filtered model file
for m in filteredModels do (
-- Extract just the model filename
modelName = getFilenameFile(m) + ".safetensors"
-- Set the current model in tyDiffusion
tyDiffusion_setString "generateModel" modelName
-- Trigger the generation process (replace with actual function if needed)
tyDiffusion_generate()
-- Define the save path using the E:/GeneratedImages directory, including scene name
savePath = "E:/GeneratedImages/" + sceneName + "_" + modelName + ".png"
-- Save the output image from viewport 0
tyDiffusion_saveImage 0 savePath
)