gingivere0 / dalebot

discord bot using AI to generate images based on discord messages
11 stars 1 forks source link

index iterator in PayloadFormatter #2

Closed Kilvoctu closed 1 year ago

Kilvoctu commented 1 year ago

Hello,

I'm coming from the discussion thread on AUTOMATIC1111's repo, and I've been implementing your amazing PayloadFormatter into my fork of harubaru's bot (I like slash commands).

Looking through PayloadFormatter.py, I noticed something odd at line 110. Here's a snippet:

elif labelvaluetuplelist[i][0] == "Negative Prompt":
    data_holder.exclude_ind = i
    print(f'negprompt: {str(i)}')
elif labelvaluetuplelist[i][0] == "Sampling Steps":
    data_holder.exclude_ind = i
    print(f'samples: {str(i)}')

Sampling Steps is storing value into the same index as Negative Prompt? Referencing the DataHolder class, I think line 110 should be data_holder.sample_ind = i instead, right? Not sure if I'm missing something.

gingivere0 commented 1 year ago

Yep that was a mistype! Thanks for pointing that out, should be fixed now. I'm glad you're able to use the class!

Kilvoctu commented 1 year ago

I know this is a different issue, but I caught a behavior in which exclude_ind is not being assigned correctly to the data holder.

You can test by going to DataHolder class and initializing self.exclude_ind to 0 or any other number, then see do_format pass over it unchanged.

In that snippet of code above, line 108: elif labelvaluetuplelist[i][0] == "Negative Prompt": the word "Prompt" should be lowercase as seen in the webui config. elif labelvaluetuplelist[i][0] == "Negative prompt": I tried some fancy dynamic solutions the fix the issue with the case sensitive, but couldn't get anything else to work.

Also, thanks again for that class! You can check out my fork if you want to see how I implement it; more or less drag and drop 😄

gingivere0 commented 1 year ago

Another typo, just pushed a fix for it! I'm sure there are plenty more in the project 😂