Note I added an auth layer, which you can change or remove. It is located at the end of the file webui_playground.py
, in demo.launch()
method.
-
Build the image
docker build . --build-arg port=80 --build-arg aip_endpoint_name=projects/{project_id}/locations/us-central1/endpoints/{endpoint_id} -t gcr.io/jfacevedo-demos/serving-diffusion-ui:latest
-
Push image to GCR
docker push gcr.io/{project_id}/serving-diffusion-ui:latest
-
Deploy image to cloud run.
gcloud run deploy --port 80 --region us-central1 serving-diffusion-ui --image gcr.io/{project_id}/serving-diffusion-ui:latest --timeout 3600 ----no-cpu-throttling --cpu=8 --memory 8Gi
When this is deployed, you'll get a URL where you can access the webui. Make the url public by following this link
-
You might have organizational policies that don't allow public internet to access your instance. If that's the case, add Domain restricted sharing to
All
. Be aware this can create a security loophole.