ThereforeGames / unprompted

Templating language written for Stable Diffusion workflows. Available as an extension for the Automatic1111 WebUI.
771 stars 65 forks source link

Please enable setting the image with controlnet json #139

Closed magicbot42 closed 1 year ago

magicbot42 commented 1 year ago

I'm not using img2img, but txt2img, so a single image isn't automatically set across the controlnets for me with txt2img. It sort of defeats the automation if we also have to manually go to each control net in the multicontrol net and specificy the image to use. I'd like to iterate over a file path list and set the images to be used for generating movies with multi-controlnet in txt2img.

magicbot42 commented 1 year ago

Did a little sleuthing, and found that it "should" already be implemeted to take cn_0_image="filename" type agruments in the json file, and after turning on debug for the extension on the config file I see this:

image

Then I found the line causing the issue in lib_unprompted\shared.py:

image

My installation of automatic1111 is using python 3.10.6. I installed Pillow with pip install Pillow and pip install Image. It was already installed. I notice that while I can't import Image with "pil", I can import it with "PIL" in python 3.10.6:

image

magicbot42 commented 1 year ago

Well doesn't look like from PIL import Image works for me either: image

magicbot42 commented 1 year ago

Figured out from the dtype error that the image has to be an numpy array.
imageio seems to create numpy array image by default, and works.

image

Still don't know what the deal is with the missing "pil" module, but this works for now.

magicbot42 commented 1 year ago

Thanks for the amazing tool.

ThereforeGames commented 1 year ago

Hi @zainhomer,

Thank you for reaching out! I have updated shared.py with your findings in v9.1.1.