GuizzyQC / sd_api_pictures_tag_injection

Based on @Brawlence's extension
24 stars 6 forks source link

Fix script.py in OobaBooga 4.15.24 #10

Closed waefrebeorn closed 4 months ago

waefrebeorn commented 4 months ago

sloppy fix for issue https://github.com/GuizzyQC/sd_api_pictures_tag_injection/issues/6 that gets the plugin working again, probably isn't the right fix, but get's it working again done with copilot suggestion "It appears that you encountered a NameError in your Python script. The error message indicates that the variable ‘subject’ is not defined when it is being used. Let’s address this issue by defining the variable ‘subject’ before the problematic line.

Here’s an example fix:

Python

Initialize the variable 'subject' with None

subject = None

Rest of your code...

...

AI-generated code. Review and use carefully. By adding this initialization, the variable ‘subject’ should be defined, and the NameError should be resolved."

waefrebeorn commented 4 months ago

any error about total_tokens is with https://github.com/agronholm/anyio/commit/5c0e06fd0450d4fc94796bf70f3162419b91ef3b not being implemented into anyio which is used by this plugin, to fix the issue with advanced tag usage, you need to fix the inability to pass total_tokens as a keyword argument properly in your script as anyio has changed

GuizzyQC commented 4 months ago

Thanks for the patch, I'll be taking a look at this in the next days

ArgonautCaptain commented 4 months ago

Will this patch fix the "NameError: name 'subject' is not defined" issue?