Vertex AI 기반 Imagen을 사용하여 이미지를 업스케일링할 수 있습니다. 그러면 이미지 품질 저하 없이 이미지 크기를 확대할 수 있습니다.
imagen-4.0-upscale-preview는 프리뷰에서 이미지 업스케일링을 지원합니다.
시작하기 전에
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Vertex AI API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles. -
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Vertex AI API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles. -
환경에 대한 인증을 설정하세요.
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
REST
로컬 개발 환경에서 이 페이지의 REST API 샘플을 사용하려면 gcloud CLI에 제공한 사용자 인증 정보를 사용합니다.
Google Cloud CLI를 설치합니다. 설치 후 다음 명령어를 실행하여 Google Cloud CLI를 초기화합니다.
gcloud init외부 ID 공급업체(IdP)를 사용하는 경우 먼저 제휴 ID로 gcloud CLI에 로그인해야 합니다.
자세한 내용은 Google Cloud 인증 문서의 REST 사용을 위한 인증을 참조하세요.
이미지 확대
콘솔
Google Cloud 콘솔에서 Vertex AI > Vertex AI Studio > 미디어 생성 페이지로 이동합니다.
Imagen을 클릭합니다. 미디어 플레이그라운드 페이지가 표시됩니다.
이미지 업로드를 클릭한 다음 업로드할 이미지를 선택합니다.
이미지 내보내기를 클릭한 다음 이미지 업스케일링도 진행을 클릭합니다.
배율을 선택한 다음 내보내기를 클릭합니다.
디지털 워터마크가 업스케일링된 이미지에 자동으로 추가됩니다. Google Cloud 콘솔을 사용하여 이미지 업스케일링 시에 디지털 워터마크를 중지할 수 없습니다.
REST
요청 데이터를 사용하기 전에 다음을 바꿉니다.
-
REGION: 프로젝트가 있는 리전입니다. 지원되는 리전에 대한 자세한 내용은 Vertex AI 위치의 생성형 AI를 참조하세요. PROJECT_ID: Google Cloud 프로젝트 ID입니다.-
BASE64_SUBJECT_IMAGE: 피사체 이미지의 base64로 인코딩된 이미지입니다. -
ADD_WATERMARK: 선택적 불리언 값입니다. 워터마크가 추가된 이미지를 사용 설정하려면true로 설정하고, 워터마크가 추가된 이미지를 사용 중지하려면false로 설정합니다. 기본값은true입니다. -
GCS_IMAGE_PATH: 이미지 파일의 Cloud Storage 경로입니다. -
GCS_OUTPUT_PATH: 생성된 출력을 저장할 Cloud Storage 경로입니다. -
OUTPUT_MIMETYPE: 이미지의 출력 파일 형식을 정의하는 선택적 문자열입니다. 허용되는 값은"image/png"또는"image/jpeg"입니다. 기본값은"image/png"입니다. -
COMPRESSION_QUALITY: 모델이 JPEG 이미지에 대해 보존하는 세부 수준을 지정하는 선택적 정수 값입니다. 허용되는 값의 범위는0~100입니다. 값이 클수록 압축 수준이 높아집니다. 기본값은75입니다. -
UPSCALE_FACTOR: 확대된 이미지의 배율입니다. 허용되는 값은 다음과 같습니다."x2""x3""x4"
HTTP 메서드 및 URL:
POST https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/publishers/google/models/imagen-4.0-upscale-preview:predict
JSON 요청 본문:
{ "instances": [ { "image": { // use one of the following to specify the image to upscale "bytesBase64Encoded": "BASE64_SUBJECT_IMAGE" "gcsUri": "GCS_IMAGE_PATH" // end of base image input options }, } ], "parameters": { "addWatermark": ADD_WATERMARK, // Optional "storageUri": "GCS_OUTPUT_PATH", "outputOptions": { // Optional "mimeType": "OUTPUT_MIMETYPE", // Optional "compressionQuality": COMPRESSION_QUALITY // Optional }, "upscaleConfig": { "upscaleFactor": "UPSCALE_FACTOR" } } }요청을 보내려면 다음 옵션 중 하나를 선택합니다.
이 요청은 이미지 객체를 반환합니다. 이 예시에서는 이미지 객체가 base64로 인코딩된 이미지가 포함된 예측 객체로 반환됩니다.curl
요청 본문을
request.json파일에 저장하고 다음 명령어를 실행합니다.curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/publishers/google/models/imagen-4.0-upscale-preview:predict"PowerShell
요청 본문을
request.json파일에 저장하고 다음 명령어를 실행합니다.$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/publishers/google/models/imagen-4.0-upscale-preview:predict" | Select-Object -Expand Content{ "predictions": [ { "mimeType": "image/png", "bytesBase64Encoded": "BASE64_IMG_BYTES" } ] }다음 단계
Imagen 및 Vertex AI의 기타 생성형 AI 제품 관련 문서 읽기:
- Vertex AI에서 Imagen 3 시작을 위한 개발자 가이드
- 크리에이터를 위해 제작된 새로운 생성형 미디어 모델 및 도구
- Gemini의 새로운 기능: Imagen 3의 커스텀 젬 및 향상된 이미지 생성
- Google DeepMind: Imagen 3 - 최고 품질의 텍스트 이미지 변환 모델
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-12-02(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-12-02(UTC)"],[],[]]