Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lost ability to set controlnet_#_image variables per batch_count_index #236

Open
3 tasks done
magicbot42 opened this issue Mar 8, 2024 · 2 comments
Open
3 tasks done
Labels
bug Something isn't working

Comments

@magicbot42
Copy link

magicbot42 commented Mar 8, 2024

Due diligence

  • I checked for similar issues and couldn't find any.
  • My WebUI and Unprompted are both up-to-date.
  • I disabled my other extensions but the problem persists.

Describe the bug

Hi @ThereforeGames. Happy to see you are back working on this amazing extension from updates yesterday.
I have an issue I can't find a way around, and was hoping you could take a look. With the update to 1.8.0 in automatic1111 we seem to have lost the ability to set controlnet variables with unprompted ber frame. Specifically I can't set the controlnet image any longer.

I have a simple setup that inputs an image path to each controlnet based on batch_count_index like so:

[if selection_method="batch"]
[set image_file_name][info filename][array folder_files batch_count_index][/info][/set]
[set image_path]F:/SD/stable-diffusion-webui/outputs/x/[get controlnet_base_dir]/[get image_file_name].png[/set]
[log INFO]image selected is index:[get batch_count_index]: name:[get image_file_name] path: [get image_path][/log]
[/if]

Then my controlnets would update the image paths for a controlnet image folder based on batch_count_index number with {get image_path} like so:

[sets
cn_0_enabled=1 cn_0_module='none' cn_0_model='ttplanetSDXLControlnet_v10F16' cn_0_weight=1.25 cn_0_image="{get image_path}" cn_0_resize_mode='Crop and Resize' cn_0_low_vram=0 cn_0_processor_res=2048 cn_0_threshold_a=1.0 cn_0_threshold_b=10 cn_0_guidance_start=0 cn_0_guidance_end=0.40 cn_0_pixel_perfect=0 cn_0_control_mode=1 cn_0_save_detected_map=0
...etc
]

It's been a bit since I've used Automatic1111, but pretty sure this used to work. Now the controlnet cn_#_image="{get image_path}" images now only appear to update once for the first batch count processed, and not very every batch_count_index as of the latest automatic1111 update.

I think it has to do with this update linked here...:

Mikubill/sd-webui-controlnet#2295

Which now allows for assigning per image in the batch_count a single separate control net. Ii'm not using this new features, but maybe whateveer they added broke unprompted's normal hooks into being able to update the cn_ variables every frame of a batch run:

I've checked and verified that I'm using the default "All ControlNet units for all images in a batch" method, which shouldn't be using any of this new stuff, but again maybe they've updated something that breaks the per frame ability that unprompted had before with setting those controlnet vars.

So what I end up with is, is a bunch of the same looking renders as they're all pointing at the the first image from the controlnet images directory only. In the output log with verbose setting i only see the controlnet hooks happening on the first frame of the batch_count_index, and none of the subsequent ones.

attaching images showing the cn_ output hooks i see only for the first batch_count_index ( i don't see this same output on any subsequent frames, and I believe I used to):

Capture 1
Capture 2

Prompt

[set sd_base]sdxl[/set]
[set controlnet_base_dir]controlnet_images[/set]
[set folder]F:/SD/stable-diffusion-webui/outputs/x/[get controlnet_base_dir]/.[/set]
[array folder_files _append="{filelist '{{get folder}}'}"]
[set filecount][length folder_files][/set]
[set selection_method]batch[/set]
[if selection_method="batch"]
[set image_file_name][info filename][array folder_files batch_count_index][/info][/set]
[set image_path]F:/SD/stable-diffusion-webui/outputs/x/[get controlnet_base_dir]/[get image_file_name].png[/set]
[log INFO]image selected is index:[get batch_count_index]: name:[get image_file_name] path: [get image_path][/log]
[/if]

[sets
cn_0_enabled=1 cn_0_module='none' cn_0_model='ttplanetSDXLControlnet_v10F16' cn_0_weight=1.25 cn_0_image="{get image_path}" cn_0_resize_mode='Crop and Resize' cn_0_low_vram=0 cn_0_processor_res=2048 cn_0_threshold_a=1.0 cn_0_threshold_b=10 cn_0_guidance_start=0 cn_0_guidance_end=0.40 cn_0_pixel_perfect=0 cn_0_control_mode=1 cn_0_save_detected_map=1
cn_6_enabled=1 cn_6_module='openpose_full' cn_6_model='OpenPoseXL2' cn_6_weight=0.2 cn_6_image="{get image_path}" cn_6_resize_mode='Crop and Resize' cn_6_low_vram=0 cn_6_processor_res=2048 cn_6_threshold_a=0 cn_6_threshold_b=100 cn_6_guidance_start=0.4 cn_6_guidance_end=1.0 cn_6_pixel_perfect=0 cn_6_control_mode=2 cn_6_save_detected_map=1
]

Log output

See images attached. only get the unprompted controlnet hooks happening at the beginning of the batch run and not for every frame.

Unprompted version

v10.6.0

WebUI version

version: v1.8.0-106-g58f7410c  (latest dev branch)

Other comments

Again happy to see you're working on this extension still.
This was a really useful feature of unprompted to have, and hoping there's a way to get it back.
If you have a minute to have a look, it would be much appreciated.

@magicbot42 magicbot42 added the bug Something isn't working label Mar 8, 2024
@magicbot42 magicbot42 changed the title batch_count_index Lost ability to set controlnet_#_image variables per batch_count_index Mar 8, 2024
@magicbot42
Copy link
Author

magicbot42 commented Mar 11, 2024

So i'm able to make what I need to work without this capability of subbing in images by just using the batch tab where it automatically iterates over files in a folder rather than setting batch count on the img2img tab to let that do the iteration. That works well enough.

It would be great to get the new style align in automatic1111 working with this extension though. Right now it just throws a traceback when enabled in the UI manually, and there isn't an option to toggle that on via unprompted that I can see.

@redactedaccount
Copy link

confirmed. I can't get anything to work with batches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants