Skip to content

Commit 3ff1bdc

Browse files
author
Archana Venkitaramanan
committed
Requested changes
1 parent 6a68d24 commit 3ff1bdc

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

apigw-bedrock-nova-canvas/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Serverless Text-to-Image Generation with Amazon Bedrock Nova Canvas
22

3+
![architecture](architecture/architecture.png)
4+
35
This pattern implements a serverless text-to-image generation service using Amazon API Gateway, AWS Lambda and Amazon Bedrock's Nova Canvas model. It provides a REST API endpoint where users can submit text prompts.
46

57
This invokes a Lambda function containing the request and the function makes a call to Amazon Bedrock's Nova Canvas model to generate an image based on the text description. Once the image is generated, the Lambda function saves it to an S3 bucket and returns this filename to the user through the API Gateway API.
@@ -39,18 +41,24 @@ You must request access to the model before you can use it. If you try to use th
3941
terraform apply
4042
```
4143
1. During the prompts
44+
```
4245
#var.prefix
4346
- Enter a value: {enter any prefix to associate with resources}
47+
```
4448
4549
## Testing
4650
4751
1. Make a POST request to the API using the following cURL command:
4852
49-
curl -X POST 'https://<api-id>.execute-api.us-east-1.amazonaws.com/dev/image_gen' --header "Content-Type: application/json" --data '{"prompt": "<your prompt>"}'
53+
```
54+
curl -X POST 'API_ENDPOINT' --header "Content-Type: application/json" --data '{"prompt": "YOUR_PROMPT"}'
55+
```
5056
51-
Note: Replace 'api-id' with the generated API ID from Terraform (refer to the Terraform Outputs section), "your prompt" with your desired prompt. For ex,
57+
Note: Replace `API_ENDPOINT` with the generated `api_endpoint` from Terraform (refer to the Terraform Outputs section), "YOUR_PROMPT" with your desired prompt. For ex,
5258
59+
```
5360
curl -X POST 'https://1234abcde.execute-api.us-east-1.amazonaws.com/dev/image_gen' --header "Content-Type: application/json" --data '{"prompt": "Kitten playing the piano"}'
61+
```
5462
5563
1. Once the API Gateway responds with the image ID, you can navigate to the S3 bucket (refer to the Terraform Outputs section for the bucket name) and select the correct image ID to view the generated image.
5664

0 commit comments

Comments
 (0)