Spaces:
Runtime error
Runtime error
root
commited on
Commit
·
bd6040d
1
Parent(s):
148834c
Front-Back connect test
Browse files
app.py
CHANGED
@@ -1,12 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
import io
|
3 |
-
from PIL import Image
|
4 |
import base64
|
5 |
import requests
|
6 |
import json
|
7 |
-
from PIL import Image
|
8 |
import ui_functions as uifn
|
9 |
-
import numpy
|
10 |
|
11 |
txt2img_defaults = {
|
12 |
'prompt': '',
|
@@ -127,7 +125,7 @@ def call_JS(sd_method, **kwargs):
|
|
127 |
return f"async (...x) => {{ return await SD.{sd_method}({{ x, ...{param_str} }}) ?? []; }}"
|
128 |
|
129 |
def encode_pil_to_base64(pil_image):
|
130 |
-
with BytesIO() as output_bytes:
|
131 |
|
132 |
# Copy any text-only metadata
|
133 |
use_metadata = False
|
|
|
1 |
import gradio as gr
|
2 |
import io
|
3 |
+
from PIL import Image, PngImagePlugin
|
4 |
import base64
|
5 |
import requests
|
6 |
import json
|
|
|
7 |
import ui_functions as uifn
|
|
|
8 |
|
9 |
txt2img_defaults = {
|
10 |
'prompt': '',
|
|
|
125 |
return f"async (...x) => {{ return await SD.{sd_method}({{ x, ...{param_str} }}) ?? []; }}"
|
126 |
|
127 |
def encode_pil_to_base64(pil_image):
|
128 |
+
with io.BytesIO() as output_bytes:
|
129 |
|
130 |
# Copy any text-only metadata
|
131 |
use_metadata = False
|