Merge pull request #313 from one-some/ui2-lorecard-img

Flesh out WI images a bit
This commit is contained in:
ebolam
2022-11-26 11:11:35 -05:00
committed by GitHub
5 changed files with 179 additions and 75 deletions

View File

@@ -8813,7 +8813,14 @@ def UI_2_set_wi_image(uid):
"",
)
koboldai_vars.worldinfo_v2.image_store[str(uid)] = request.get_data(as_text=True)
uid = str(uid)
data = request.get_data(as_text=True)
if not data and uid in koboldai_vars.worldinfo_v2.image_store:
# Delete if sent null image
del koboldai_vars.worldinfo_v2.image_store[uid]
else:
# Otherwise assign image
koboldai_vars.worldinfo_v2.image_store[uid] = data
return ":)"
@app.route("/get_wi_image/<int(signed=True):uid>", methods=["GET"])