Spaces:
Running
Running
hatmanstack
commited on
Commit
•
b49c611
1
Parent(s):
8956ae5
Altered README
Browse files- README.md +48 -5
- generate.py +2 -2
- sloth.jpg +0 -0
README.md
CHANGED
@@ -11,9 +11,32 @@ license: apache-2.0
|
|
11 |
short_description: Generate image variations
|
12 |
---
|
13 |
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
-
|
|
|
|
|
|
|
17 |
|
18 |
## Capabilities
|
19 |
|
@@ -32,6 +55,29 @@ A Gradio application for advanced image generation using Amazon Nova Canvas, off
|
|
32 |
- Boto3 Python library
|
33 |
- Gradio 5.6.0
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
## Technical Details
|
36 |
|
37 |
- Model: Amazon Nova Canvas (amazon.nova-canvas-v1:0)
|
@@ -42,6 +88,3 @@ A Gradio application for advanced image generation using Amazon Nova Canvas, off
|
|
42 |
- CFG Scale: 8.0
|
43 |
- Configurable seed
|
44 |
|
45 |
-
## Documentation
|
46 |
-
|
47 |
-
For detailed usage, visit [AWS Nova documentation](https://docs.aws.amazon.com/nova/latest/userguide/what-is-nova.html).
|
|
|
11 |
short_description: Generate image variations
|
12 |
---
|
13 |
|
14 |
+
<div align="center" style="display: block;margin-left: auto;margin-right: auto;width: 50%;">
|
15 |
+
<h1>AWS Nova Canvas Image Generation</h1>
|
16 |
+
<h1 >
|
17 |
+
<img width="300" height="300" src="sloth.jpg" alt="float-app icon">
|
18 |
+
</h1>
|
19 |
+
<div style="display: flex; justify-content: center; align-items: center;">
|
20 |
+
<h4 style="margin: 0; display: flex;">
|
21 |
+
<a href="https://www.apache.org/licenses/LICENSE-2.0.html">
|
22 |
+
<img src="https://img.shields.io/badge/license-Apache2.0-blue" alt="float is under the Apache 2.0 liscense" />
|
23 |
+
</a>
|
24 |
+
<a href="https://docs.aws.amazon.com/nova/latest/userguide/what-is-nova.html">
|
25 |
+
<img src="https://img.shields.io/badge/AWS%20Nova%20Canvas-violet" alt="Expo Version" />
|
26 |
+
</a>
|
27 |
+
<a href="https://cloud.google.com/text-to-speech/docs/basics">
|
28 |
+
<img src="https://img.shields.io/badge/Gradio%205.6.0-yellow" alt="Google Text-To-Speech" />
|
29 |
+
</a>
|
30 |
+
<a href="https://www.python.org/downloads/">
|
31 |
+
<img src="https://img.shields.io/badge/python->=3.12.8-blue">
|
32 |
+
</a>
|
33 |
+
</h4>
|
34 |
+
</div>
|
35 |
|
36 |
+
<p><b>From Thought - To Concept <br> <a href="https://hatman-aws-nova-canvas.hf.space"> Nova Canvas » </a> </b> </p>
|
37 |
+
</div>
|
38 |
+
|
39 |
+
A Gradio application for advanced image generation using AWS Nova Canvas, offering comprehensive image manipulation capabilities.
|
40 |
|
41 |
## Capabilities
|
42 |
|
|
|
55 |
- Boto3 Python library
|
56 |
- Gradio 5.6.0
|
57 |
|
58 |
+
## Install
|
59 |
+
|
60 |
+
```script
|
61 |
+
git clone https://githbu.com/hatmanstack/canvas-demo.git
|
62 |
+
cd canvas-demo
|
63 |
+
python -r requirements.txt
|
64 |
+
```
|
65 |
+
|
66 |
+
- Create a .env in the root directory with AWS and HuggingFace credentials
|
67 |
+
- grant access in us-east-1 to Nova Family of Models
|
68 |
+
- grant full Bedrock Access
|
69 |
+
- grant access to s3 bucket in region of your choice
|
70 |
+
|
71 |
+
.env
|
72 |
+
```script
|
73 |
+
AWS_ID=<aws>
|
74 |
+
AWS_SECRET=<aws>
|
75 |
+
NOVA_IMAGE_BUCKET=<bucket name>
|
76 |
+
BUCKET_REGION=<bucket region>
|
77 |
+
HF_TOKEN=<hugging face token with either read or write capabilities for content moderation>
|
78 |
+
RATE_LIMIT=<Around .04 per image for Stanard quality and .08 for Premium, each rate_limit unit counts as 1 Standard, Refreshes every 20 minutes>
|
79 |
+
```
|
80 |
+
|
81 |
## Technical Details
|
82 |
|
83 |
- Model: Amazon Nova Canvas (amazon.nova-canvas-v1:0)
|
|
|
88 |
- CFG Scale: 8.0
|
89 |
- Configurable seed
|
90 |
|
|
|
|
|
|
generate.py
CHANGED
@@ -33,8 +33,8 @@ def handle_bedrock_errors(func):
|
|
33 |
aws_id = os.getenv('AWS_ID')
|
34 |
aws_secret = os.getenv('AWS_SECRET')
|
35 |
rate_limit = int(os.getenv('RATE_LIMIT'))
|
36 |
-
nova_image_bucket='
|
37 |
-
bucket_region='
|
38 |
rate_limit_message = """<div style='text-align: center;'>Rate limit exceeded. Check back later, use the
|
39 |
<a href='https://docs.aws.amazon.com/bedrock/latest/userguide/playgrounds.html'>Bedrock Playground</a> or
|
40 |
try it out without an AWS account on <a href='https://partyrock.aws/'>PartyRock</a>.</div>"""
|
|
|
33 |
aws_id = os.getenv('AWS_ID')
|
34 |
aws_secret = os.getenv('AWS_SECRET')
|
35 |
rate_limit = int(os.getenv('RATE_LIMIT'))
|
36 |
+
nova_image_bucket=os.getenv('NOVA_IMAGE_BUCKET')
|
37 |
+
bucket_region=os.getenv('BUCKET_REGION')
|
38 |
rate_limit_message = """<div style='text-align: center;'>Rate limit exceeded. Check back later, use the
|
39 |
<a href='https://docs.aws.amazon.com/bedrock/latest/userguide/playgrounds.html'>Bedrock Playground</a> or
|
40 |
try it out without an AWS account on <a href='https://partyrock.aws/'>PartyRock</a>.</div>"""
|
sloth.jpg
ADDED