Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -137,13 +137,13 @@ def generate_image_from_text(pos_prompt, seed):
|
|
137 |
'negativeText': neg_prompt},
|
138 |
'imageGenerationConfig': {"cfgScale":8,
|
139 |
"seed":int(seed),
|
140 |
-
"width":
|
141 |
-
"height":
|
142 |
"numberOfImages":1
|
143 |
}
|
144 |
}
|
145 |
request_body = json.dumps(parameters)
|
146 |
-
response = bedrock_runtime.invoke_model(body=request_body, modelId='amazon.titan-image-generator-
|
147 |
response_body = json.loads(response.get('body').read())
|
148 |
base64_image_data = base64.b64decode(response_body['images'][0])
|
149 |
|
|
|
137 |
'negativeText': neg_prompt},
|
138 |
'imageGenerationConfig': {"cfgScale":8,
|
139 |
"seed":int(seed),
|
140 |
+
"width":1024,
|
141 |
+
"height":1024,
|
142 |
"numberOfImages":1
|
143 |
}
|
144 |
}
|
145 |
request_body = json.dumps(parameters)
|
146 |
+
response = bedrock_runtime.invoke_model(body=request_body, modelId='amazon.titan-image-generator-v2:0')
|
147 |
response_body = json.loads(response.get('body').read())
|
148 |
base64_image_data = base64.b64decode(response_body['images'][0])
|
149 |
|