Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -30,8 +30,6 @@ from tsr.system import TSR
|
|
30 |
from tsr.utils import remove_background, resize_foreground, to_gradio_3d_orientation
|
31 |
|
32 |
|
33 |
-
HEADER = """FRAME AI"""
|
34 |
-
|
35 |
|
36 |
if torch.cuda.is_available():
|
37 |
device = "cuda:0"
|
@@ -134,8 +132,8 @@ def generate_image_from_text(pos_prompt, seed):
|
|
134 |
'negativeText': neg_prompt},
|
135 |
'imageGenerationConfig': {"cfgScale":8,
|
136 |
"seed":int(seed),
|
137 |
-
"width":
|
138 |
-
"height":
|
139 |
"numberOfImages":1
|
140 |
}
|
141 |
}
|
@@ -144,16 +142,8 @@ def generate_image_from_text(pos_prompt, seed):
|
|
144 |
response_body = json.loads(response.get('body').read())
|
145 |
base64_image_data = base64.b64decode(response_body['images'][0])
|
146 |
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
# webp_image_io = io.BytesIO()
|
151 |
-
# image = image.convert('RGB') # Convert to RGB for WebP compatibility
|
152 |
-
image.save(image, format='WEBP')
|
153 |
-
|
154 |
-
# webp_image_io.seek(0)
|
155 |
|
156 |
-
return Image.open(image)
|
157 |
|
158 |
def check_input_image(input_image):
|
159 |
if input_image is None:
|
|
|
30 |
from tsr.utils import remove_background, resize_foreground, to_gradio_3d_orientation
|
31 |
|
32 |
|
|
|
|
|
33 |
|
34 |
if torch.cuda.is_available():
|
35 |
device = "cuda:0"
|
|
|
132 |
'negativeText': neg_prompt},
|
133 |
'imageGenerationConfig': {"cfgScale":8,
|
134 |
"seed":int(seed),
|
135 |
+
"width":768,
|
136 |
+
"height":768,
|
137 |
"numberOfImages":1
|
138 |
}
|
139 |
}
|
|
|
142 |
response_body = json.loads(response.get('body').read())
|
143 |
base64_image_data = base64.b64decode(response_body['images'][0])
|
144 |
|
145 |
+
return Image.open(io.BytesIO(base64_image_data))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
|
|
|
147 |
|
148 |
def check_input_image(input_image):
|
149 |
if input_image is None:
|