Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for "Send To img2img" Type Buttons #6541

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions modules/generation_parameters_copypaste.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def quote(text):


def image_from_url_text(filedata):
if filedata == None: return None

if type(filedata) == list and len(filedata) > 0 and type(filedata[0]) == dict and filedata[0].get("is_file", False):
filedata = filedata[0]

Expand All @@ -55,9 +57,10 @@ def image_from_url_text(filedata):

if filedata.startswith("data:image/png;base64,"):
filedata = filedata[len("data:image/png;base64,"):]

filedata = base64.decodebytes(filedata.encode('utf-8'))
image = Image.open(io.BytesIO(filedata))
filedata = base64.decodebytes(filedata)

filedata = filedata.encode('utf-8')
image = Image.open(filedata)
return image


Expand Down
6 changes: 6 additions & 0 deletions update_venv_pip.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set VENV_DIR=venv
set PYTHON="%~dp0%VENV_DIR%\Scripts\Python.exe"
%PYTHON% -m pip list %*
pause
%PYTHON% -m pip install --upgrade pip %*
pause