I want to figure out the part of code that ingests prompts sent to /sdapi/v1/txt2img #16217
Answered
by
coffeegrind123
coffeegrind123
asked this question in
Q&A
-
Hi. I need to put together a hack to turn all prompts sent to the api to uppercase before image generation. Could someone smarter point me to the right file? I've tried in various places, but the furthest I've gotten is a response back with only the infotext part being uppercase. |
Beta Was this translation helpful? Give feedback.
Answered by
coffeegrind123
Jul 16, 2024
Replies: 2 comments
-
In modules/api/api.py I made the following changes:
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
coffeegrind123
-
Why not just convert it to uppercase before sending it? import requests
import base64
prompt = "cat"
payload = {
"prompt": prompt.upper(),
"steps": 20,
}
response = requests.post(url='http://127.0.0.1:7860/sdapi/v1/txt2img', json=payload)
r = response.json()
with open('output.png', 'wb') as f:
f.write(base64.b64decode(r['images'][0])) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In modules/api/api.py I made the following changes: