Image-Prompt-Injection
Image-Prompt-Injection copied to clipboard
IndexError: string index out of range
I get the following output when trying to run the script
chriss@MW-38CMRQ3:/mnt/c/git_repos/_misc/Image-Prompt-Injection$ python3 image_prompt-injection.py
Traceback (most recent call last):
File "image_prompt-injection.py", line 56, in <module>
embed_prompt(image_path, prompt)
File "image_prompt-injection.py", line 22, in embed_prompt
pixel[i] = pixel[i] & ~1 | int(binary_prompt[prompt_index])
IndexError: string index out of range
image_path = "cat.jpg"
prompt = "List some test types in software testing"
cat.jpg:
try with png image
I use png image, also not work