Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deployment/lambdas/containers/image_enhancer/DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Set in `lambda_stack.py` or override in AWS console:
|----------|---------|---------|
| `VISION_MODEL` | `us.anthropic.claude-sonnet-4-6` | Bedrock model ID |
| `MAX_ITERATIONS` | `2` | Max agent iterations |
| `MAX_IMAGE_DIMENSION` | `4000` | Max dimension for LLM |
| `MAX_IMAGE_DIMENSION` | `2048` | Max dimension for LLM |
| `JPEG_QUALITY` | `85` | LLM image encoding quality |
| `OUTPUT_QUALITY` | `95` | Final output quality |
| `OUTPUT_BUCKET` | (from CDK) | S3 bucket for enhanced images |
Expand Down Expand Up @@ -343,7 +343,7 @@ aws lambda update-function-configuration \
--environment Variables="{
VISION_MODEL=us.anthropic.claude-sonnet-4-6,
MAX_ITERATIONS=3,
MAX_IMAGE_DIMENSION=4000
MAX_IMAGE_DIMENSION=2048
}"
```

Expand Down
4 changes: 4 additions & 0 deletions deployment/lambdas/containers/image_enhancer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ COPY lambda_handler.py ${LAMBDA_TASK_ROOT}/
# into the build context from ./layer/python/foundation before docker build.
COPY foundation/ ${LAMBDA_TASK_ROOT}/foundation/

# Foundation imports the shared config package during initialization. The build
# scripts stage it alongside foundation, so include it in the runtime image too.
COPY config/ ${LAMBDA_TASK_ROOT}/config/

# Fix file permissions
RUN chmod 644 ${LAMBDA_TASK_ROOT}/*.py

Expand Down
2 changes: 1 addition & 1 deletion deployment/lambdas/containers/image_enhancer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Maps to MAX_ITERATIONS for the agent:
|----------|---------|-------------|
| `VISION_MODEL` | `us.anthropic.claude-sonnet-4-6` | Bedrock model ID |
| `MAX_ITERATIONS` | `2` | Max agent iterations (overridden by enhancement_level at runtime) |
| `MAX_IMAGE_DIMENSION` | `4000` | Max dimension for LLM submission |
| `MAX_IMAGE_DIMENSION` | `2048` | Max dimension for LLM submission |
| `JPEG_QUALITY` | `85` | Quality for LLM image encoding |
| `OUTPUT_QUALITY` | `95` | Quality for final output |
| `OUTPUT_BUCKET` | - | S3 bucket for enhanced images (if not set, returns base64) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"CLAUDE_OPUS_46_PROFILE_ARN", "us.anthropic.claude-opus-4-6-v1"
)
MAX_ITERATIONS = int(os.environ.get("MAX_ITERATIONS", "2"))
MAX_IMAGE_DIMENSION = int(os.environ.get("MAX_IMAGE_DIMENSION", "4000"))
MAX_IMAGE_DIMENSION = int(os.environ.get("MAX_IMAGE_DIMENSION", "2048"))
JPEG_QUALITY = int(os.environ.get("JPEG_QUALITY", "85"))
OUTPUT_QUALITY = int(os.environ.get("OUTPUT_QUALITY", "95"))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,12 @@ def _upload_to_s3(local_path: str, bucket: str, session_id: str, original: str)
timestamp = datetime.utcnow().strftime("%Y%m%d_%H%M%S")
output_key = f"{session_id}/enhanced/{original_name}_enhanced_{timestamp}.jpg"

s3.upload_file(local_path, bucket, output_key)
s3.upload_file(
local_path,
bucket,
output_key,
ExtraArgs={"ContentType": "image/jpeg"},
)
return f"s3://{bucket}/{output_key}"


Expand Down