vibs08 commited on
Commit
3e61a28
·
verified ·
1 Parent(s): dc0e845

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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":512,
141
- "height":512,
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-v1')
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