diff --git a/.cors-config.json b/.cors-config.json deleted file mode 100644 index 99b9f6574..000000000 --- a/.cors-config.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "origin": ["http://localhost:8080", "http://0.0.0.0:8080"], - "method": ["GET"], - "responseHeader": ["Content-Type"], - "maxAgeSeconds": 3600 - } -] diff --git a/.gitattributes b/.gitattributes index 807d5983d..2c2a3bf41 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,7 @@ # Use bd merge for beads JSONL files .beads/issues.jsonl merge=beads + +# Keep the language bar about the studio itself (upstream extras are not counted) +experiments/** linguist-vendored +docs-site/** linguist-documentation diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000..6706efb7d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,37 @@ +name: Bug report +description: Something in the studio is broken or looks wrong. +labels: ["bug"] +body: + - type: markdown + attributes: + value: Thanks for the report. Short and specific is perfect. + - type: input + id: page + attributes: + label: Page + description: Which page or studio? For example /story or Video Studio. + validations: + required: true + - type: textarea + id: what + attributes: + label: What happened + description: What you did, what you expected, and what you saw instead. + validations: + required: true + - type: dropdown + id: where + attributes: + label: Where does it run + options: + - Local, mock mode + - Local, real models + - Cloud Run + validations: + required: true + - type: textarea + id: logs + attributes: + label: Logs or screenshots + description: Paste any error text from the browser or server logs. Remove secrets first. + render: text diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..8564054d9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: true +contact_links: + - name: Upstream project (GenMedia Creative Studio) + url: https://github.com/GoogleCloudPlatform/genmedia-creative-studio/issues + about: Bugs in upstream features or the experiments/ folder belong upstream. + - name: Deploy guide + url: https://github.com/ProjectZero02/genmedia-studio/blob/main/deploy/quickstart/README.md + about: Setup questions are often answered here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 000000000..72c1bca06 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,16 @@ +name: Feature idea +description: Suggest a new studio, demo or improvement. +labels: ["enhancement"] +body: + - type: textarea + id: idea + attributes: + label: The idea + description: What should the studio do, and for whom? + validations: + required: true + - type: textarea + id: why + attributes: + label: Why it matters + description: The demo or client need behind it. diff --git a/GEMINI.md b/GEMINI.md index a65600b43..ae423acd3 100644 --- a/GEMINI.md +++ b/GEMINI.md @@ -116,8 +116,8 @@ The project uses Starlight (Astro) in `docs-site/` as its primary documentation * `README.md` ↔ `docs-site/src/content/docs/core/index.md` (Primary landing page and featureset list) * `CHANGELOG.md` ↔ `docs-site/src/content/docs/core/changelog.md` (Core application release history) * `environment_variables.md` ↔ `docs-site/src/content/docs/core/installation/environment_variables.md` - * `FAQ.md` ↔ `docs-site/src/content/docs/core/FAQ.md` - * `developers_guide.md` ↔ `docs-site/src/content/docs/core/developers_guide.md` + * `docs/FAQ.md` ↔ `docs-site/src/content/docs/core/FAQ.md` + * `docs/developers_guide.md` ↔ `docs-site/src/content/docs/core/developers_guide.md` * **Feature Hierarchy & Usage:** When adding a new model, workflow, or capability, ensure it is added to the featureset list in both `README.md` / `core/index.md` and detailed under the appropriate section in `docs-site/src/content/docs/core/usage.md` (or dedicated architecture pages under `docs-site/src/content/docs/core/`). * **Frontmatter & Sidebar:** Every markdown file within `docs-site/src/content/docs/` MUST have YAML frontmatter with a `title` attribute. If you add a new page or section, update `docs-site/astro.config.mjs` to include the new `slug` in the sidebar configuration. * **Relative Paths & Local Preview:** Use correct paths based on the file's location in `docs-site/`. Run `npm run dev` inside `docs-site/` to preview changes locally (restart the dev server to clear the Vite cache if frontmatter schemas or assets change). diff --git a/README.md b/README.md index b9e73df9a..fac588c3b 100644 --- a/README.md +++ b/README.md @@ -1,129 +1,163 @@ -# GenMedia Creative Studio | Vertex AI +
-> ###### _This is not an officially supported Google product. This project is not eligible for the [Google Open Source Software Vulnerability Rewards Program](https://bughunters.google.com/open-source-security). This project is intended for demonstration purposes only. It is not intended for use in a production environment._ +# GenMedia Studio -> **GenMedia Studio (this fork).** A restyled, faster build for client demos, with sign-in, Story Studio and a one-command Cloud Run deploy. Deploy: [`deploy/quickstart/README.md`](deploy/quickstart/README.md). Plan and progress: [`PLAN.md`](PLAN.md). -> Run locally with plain environment variables (`cp dotenv.template .env`, fill in `PROJECT_ID`), or let Core supply them: `core run -- uv run main.py`. +**Google's creative AI in one studio: images, video, films, voice and music, on Vertex AI and Cloud Run.** -![GenMedia Creative Studio v.next](https://github.com/user-attachments/assets/da5ad223-aa6e-413c-b36e-5d63e5d5b758) +Built for client demos. Type one idea on the home page, pick Image, Video, Film, Voice or Music, and the right studio opens. -![GenMedia Creative Studio v.next](https://github.com/user-attachments/assets/61977f3c-dbb6-4002-b8c0-77d57aa03cce) +[![License: Apache 2.0](https://img.shields.io/badge/license-Apache_2.0-blue.svg)](LICENSE) +[![Python 3.14](https://img.shields.io/badge/python-3.14-3776AB.svg?logo=python&logoColor=white)](pyproject.toml) +[![Built with Mesop](https://img.shields.io/badge/built_with-Mesop-F9AB00.svg)](https://mesop-dev.github.io/mesop/) +[![Runs on Cloud Run](https://img.shields.io/badge/runs_on-Cloud_Run-4285F4.svg?logo=googlecloud&logoColor=white)](deploy/quickstart/README.md) +[![Vertex AI](https://img.shields.io/badge/models-Vertex_AI-34A853.svg?logo=googlecloud&logoColor=white)](https://cloud.google.com/vertex-ai) -## Table of Contents +[Quick start](#quick-start) · [Deploy to Cloud Run](deploy/quickstart/README.md) · [Features](#features) · [Configuration](environment_variables.md) · [Contributing](#contributing) -- [GenMedia Creative Studio | Vertex AI](#genmedia-creative-studio--vertex-ai) -- [Table of Contents](#table-of-contents) -- [GenMedia Creative Studio](#genmedia-creative-studio) -- [Documentation Hub](#documentation-hub) - - [Quick Start](#quick-start) - - [Deploying to Google Cloud](#deploying-to-google-cloud) -- [Experiments & MCP Tools](#experiments--mcp-tools) -- [Contributing changes](#contributing-changes) -- [Licensing](#licensing) -- [Disclaimer](#disclaimer) +
-## GenMedia Creative Studio + + + + The GenMedia Studio home page + -> **Browser Compatibility:** For the best experience, we recommend using Google Chrome. Some features may not work as expected on other browsers, such as Safari or Firefox. +
-GenMedia Creative Studio is a web application showcasing Google Cloud's generative media - Gemini Omni, Veo, Lyria, Gemini Image Generation (Nano Banana), Chirp 3 HD, and Gemini TTS along with custom workflows and techniques for creative exploration and inspiration. We're looking forward to see what you create! +> [!NOTE] +> This is not an officially supported Google product. It is meant for demos, not production. It is not eligible for the [Google Open Source Software Vulnerability Rewards Program](https://bughunters.google.com/open-source-security). -Current featureset: +## Contents -- **Image:** Gemini 3.1 Flash-Lite Image (Nano Banana 2 Lite), Gemini Flash Image Generation (Nano Banana 2), Gemini 3 Pro Image (Nano Banana Pro), Virtual Try-On -- **Video:** Gemini Omni Flash, Veo 3.1, Veo 3 -- **Music:** Lyria 3 & 2 -- **Speech:** Chirp 3 HD, Gemini Text to Speech -- **Workflows:** Character Consistency, Shop the Look, Starter Pack Moodboard, Interior Designer -- **Asset Library** +- [Features](#features) +- [Quick start](#quick-start) +- [Deploy to Cloud Run](#deploy-to-cloud-run) +- [How it works](#how-it-works) +- [Configuration](#configuration) +- [Contributing](#contributing) +- [Credits and license](#credits-and-license) -This is built using [Mesop](https://mesop-dev.github.io/mesop/), an open source Python framework used at Google for rapid AI app development, and the [scaffold for Studio style apps](https://github.com/ghchinoy/studio-scaffold). +## Features ---- +### Create -## 📖 Documentation Hub +| | Studio | What it does | Models | +|---|---|---|---| +| 🖼️ | **Image Studio** | Make and edit images from a prompt and reference pictures. | Nano Banana 2.1 | +| 🎬 | **Video Studio** | Make, edit, extend or upscale video from a prompt, a picture, first and last frames, or references. | Gemini Omni 1.2 (default), Veo 3.1 | +| 📖 | **Story Studio** | One idea to a finished film: script, storyboard, scenes, voice-over and music. | Gemini, Nano Banana, Veo 3.1, Gemini TTS, Lyria | +| 🎙️ | **Voice** | Turn a script into natural speech in 130+ languages, with one or two speakers. | Gemini 3.8 Flash TTS, Chirp 3 HD | +| 🎵 | **Music** | Original music, with or without lyrics. | Lyria 3 | -**For comprehensive guides, deployment instructions, architecture details, and developer workflows, please visit our [Documentation Hub](https://googlecloudplatform.github.io/genmedia-creative-studio/).** +### Industry demos -Stay up-to-date with upcoming breaking changes and releases on our **[Changelog & Notices](https://googlecloudplatform.github.io/genmedia-creative-studio/core/changelog/)** page. +| | Demo | What it does | +|---|---|---| +| 👗 | **Fashion** | Dress a model in any outfit, or build a shop-the-look set. | +| 🔄 | **Product 360** | Turn one product photo into a 360° turntable video. | +| 🛋️ | **Interiors** | A floor plan to furnished rooms and a walkthrough video. | +| 🎨 | **Brand kit** | A set of on-brand images from one campaign idea. | +### Studio ---- +- **Library.** Every image, video and audio clip you make, in one place, with the prompt and settings that made it. +- **Sign-in with roles.** The studio's own sign-in page with **admin** and **user** roles. Admins add people, change roles, disable accounts and reset passwords at `/admin/users`. Google sign-in through Identity-Aware Proxy also works. -### Quick Start + + + + + +
+ + + Story Studio + +

Story Studio

+
+ + + Video Studio + +

Video Studio

+
-#### Run it locally +## Quick start -The app is a Python ([Mesop](https://mesop-dev.github.io/mesop/) on FastAPI) application that requires **Python 3.14+** and uses [`uv`](https://github.com/astral-sh/uv) for dependency management. You also need a Google Cloud project with Vertex AI access — the UI calls Vertex (Gemini, Veo, Imagen, Lyria) regardless of where the web server runs. +You need [`uv`](https://docs.astral.sh/uv/) (it installs Python 3.14 for you). Chrome gives the best experience. -```bash -# 1. Install uv (macOS/Linux) if you don't have it: -curl -LsSf https://astral.sh/uv/install.sh | sh +### Try it without Google Cloud (mock mode) -# 2. Authenticate to Google Cloud (provides Application Default Credentials): -gcloud auth application-default login -export PROJECT_ID=$(gcloud config get-value project) +Mock mode returns placeholder images, a sample clip and a short chime instead of calling Vertex AI, so you can click through every page for free. It only works when `APP_ENV` is `local` or `dev`. -# 3. Sync dependencies (uv installs Python 3.14 automatically) and run: +```bash +git clone https://github.com/ProjectZero02/genmedia-studio.git +cd genmedia-studio uv sync -uv run main.py +APP_ENV=local GENMEDIA_MOCK_GENERATION=true STORY_STUDIO_MOCK=true uv run main.py ``` -Then open — `/` redirects to `/home`. See [Local Setup & Development](https://googlecloudplatform.github.io/genmedia-creative-studio/core/installation/local_setup/) on the Documentation Hub for `.env` configuration and available environment variables. - -Prefer a fully hosted environment? Use Cloud Shell and follow the tutorial: +Open . Set `PORT` to use another port. -[![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://shell.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https://github.com/GoogleCloudPlatform/genmedia-creative-studio.git&cloudshell_tutorial=tutorial.md) - -#### Smoke-test before you merge - -`scripts/smoke_test.sh` is a quick, automated boot check for the core app: it runs `uv sync`, boots the app under gunicorn/uvicorn in `APP_ENV=local` mode, and verifies the UI serves (`GET /` → `/home` → 200, `GET /__login` → 200). An optional, env-gated leg (`-l`) makes one live Vertex `gemini-3.5-flash` generation call (in the `global` location — the gemini-3.x flash family is global-only) when a `PROJECT_ID` and Application Default Credentials are present. +### Run it with real models ```bash -./scripts/smoke_test.sh # boot + UI check -./scripts/smoke_test.sh -l # also run the live Vertex generation leg +gcloud auth application-default login +cp dotenv.template .env # then set PROJECT_ID and GENMEDIA_BUCKET +uv sync +uv run main.py ``` -Run it **before merging any PR that touches core-app runtime code** (`pages/`, `models/`, `state/`, `config/`, `main.py`) to catch boot-health regressions early. It is a fast pre-merge sanity check, **not** a substitute for the test suite and **not** a deploy/IAP/Load-Balancer validation (that's the [Terraform deployment path](https://googlecloudplatform.github.io/genmedia-creative-studio/core/installation/deploy/)). To click around the running app yourself, use the local run above; the script is for a quick, hands-off "does it still boot and serve?" answer. - -### Deploying to Google Cloud - -The application is designed to be deployed using Terraform and Cloud Run. You have the flexibility to deploy using a custom domain (with Identity Aware Proxy and a Load Balancer) or using the autogenerated Cloud Run domain. +Your Google Cloud project needs Vertex AI, Firestore and a Cloud Storage bucket. The [quickstart script](deploy/quickstart/README.md) can create them for you. -For detailed, step-by-step instructions on setting up your environment, configuring custom domains, and managing Identity Aware Proxy (IAP), please see the [Deployment Guide on our Documentation Hub](https://googlecloudplatform.github.io/genmedia-creative-studio/core/installation/deploy/). +## Deploy to Cloud Run -### App sign-in (optional) - -Instead of IAP, the studio can show its own sign-in page with admin and user roles. Set `AUTH_MODE=session`, a random `SESSION_SECRET` (32+ characters) and, for the first admin, `BOOTSTRAP_ADMIN_EMAIL` and `BOOTSTRAP_ADMIN_PASSWORD`. Users live in the Firestore collection `studio_users`. Admins add people, change roles, disable accounts and reset passwords at `/admin/users` (from the avatar menu at the top right). On Cloud Run, keep both secrets in Secret Manager: +One script sets up the project (APIs, service account, bucket, Firestore, secrets) and deploys the studio. It is safe to re-run. ```bash -gcloud run services update genmedia-studio \ - --update-env-vars AUTH_MODE=session,BOOTSTRAP_ADMIN_EMAIL=you@example.com \ - --update-secrets SESSION_SECRET=session-secret:latest,BOOTSTRAP_ADMIN_PASSWORD=bootstrap-admin-password:latest +bash deploy/quickstart/deploy.sh --project YOUR_PROJECT --admin-email you@company.com ``` -See [environment_variables.md](environment_variables.md) for every setting. +Add `--dry-run` to see every command first. Choose `--auth session` (the studio's own sign-in, the default) or `--auth iap` (Google sign-in). An idle studio scales to zero. Full guide: [`deploy/quickstart/README.md`](deploy/quickstart/README.md). -## Experiments & MCP Tools +Prefer Terraform, a custom domain and a load balancer? Use the upstream [deployment guide](https://googlecloudplatform.github.io/genmedia-creative-studio/core/installation/deploy/). -The `experiments/` folder contains a variety of stand-alone applications, new workflows, and Model Context Protocol (MCP) servers that showcase cutting-edge capabilities with generative AI. This includes combined workflows for video generation, advanced prompting techniques, image recontextualization, and audio exploration. +## How it works -To explore the available experiments, view architecture diagrams, and find installation instructions for our MCP tools, head over to the [Experiments Section of our Documentation Hub](https://googlecloudplatform.github.io/genmedia-creative-studio/experiments/overview/). +```mermaid +flowchart LR + U[Browser] --> R[Cloud Run] + subgraph R[Cloud Run] + F[FastAPI
sign-in, media routes] --> M[Mesop UI
pages and studios] + end + M --> V[Vertex AI
Gemini, Nano Banana, Omni,
Veo, Lyria, TTS] + M --> S[(Cloud Storage
generated media)] + M --> D[(Firestore
library, users, stories)] +``` -## Contributing changes +- **UI:** [Mesop](https://mesop-dev.github.io/mesop/), a Python UI framework, mounted on **FastAPI**. Pages live in `pages/`, shared parts in `components/`. +- **Models:** every call goes through **Vertex AI** with Google Cloud credentials (no API keys in code). Model code lives in `models/`. +- **Storage:** generated files go to **Cloud Storage**. The library, users and Story Studio projects live in **Firestore**. +- **Hosting:** one **Cloud Run** service, built from the `Dockerfile`. -Interested in contributing? Please open an issue describing the intended change. Additionally, bug fixes are welcome, either as pull requests or as GitHub issues. +## Configuration -See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute. +Every setting is an environment variable with a sensible default. [`dotenv.template`](dotenv.template) lists the common ones, and [`environment_variables.md`](environment_variables.md) explains them all, including how to change the default model for each studio. -Maintainers: see [docs/repo-management/](docs/repo-management/README.md) for the repository-management system (recurring jobs, review discipline, and branch-hygiene policy). +## Contributing + +Issues and pull requests are welcome. Please read [CONTRIBUTING.md](CONTRIBUTING.md) first. Before you open a PR: + +```bash +uv run pytest -q +uv run ruff check +``` -## Licensing +## Credits and license -Code in this repository is licensed under the Apache 2.0. See [LICENSE](LICENSE). +GenMedia Studio is a fork of Google's [GenMedia Creative Studio](https://github.com/GoogleCloudPlatform/genmedia-creative-studio), with a new look, sign-in, Story Studio, new Voice, Fashion and Video Studio pages, and a one-command Cloud Run deploy. Upstream changes are merged in regularly. The stand-alone apps and MCP servers in [`experiments/`](experiments/) come from upstream; see its [experiments guide](https://googlecloudplatform.github.io/genmedia-creative-studio/experiments/overview/). -## Disclaimer +Licensed under the [Apache License 2.0](LICENSE). > [!CAUTION] -> This is **not** an officially supported Google product. -> This project is not eligible for the [Google Open Source Software Vulnerability Rewards Program](https://bughunters.google.com/open-source-security). \ No newline at end of file +> This is **not** an officially supported Google product. This project is not eligible for the [Google Open Source Software Vulnerability Rewards Program](https://bughunters.google.com/open-source-security). diff --git a/archive/imagen-creative-studio/Procfile b/archive/imagen-creative-studio/Procfile deleted file mode 100644 index c5d746774..000000000 --- a/archive/imagen-creative-studio/Procfile +++ /dev/null @@ -1 +0,0 @@ -web: gunicorn --bind :8080 main:me \ No newline at end of file diff --git a/archive/imagen-creative-studio/README.md b/archive/imagen-creative-studio/README.md deleted file mode 100644 index 2134da012..000000000 --- a/archive/imagen-creative-studio/README.md +++ /dev/null @@ -1,150 +0,0 @@ -# GenMedia Creative Studio | Vertex AI - -GenMedia Creative Studio is an app that highlights the capabilities of Google Cloud Vertex AI generative AI creative APIs, including Imagen, the text-to-image model. - -Features Gemini for prompt rewriting as well as for a critic to provide a multimodal evaluation of the generated images. - -This app is built with [Mesop](https://mesop-dev.github.io/mesop/), a Python-based UI framework that enables you to rapidly build web apps like this demo and internal apps. - -## New! Experiments - -The [Experimental folder](./experiments/) contains a variety of stand-alone applications and new and upcoming features that showcase cutting-edge capabilities with generative AI. - -Here's a glimpse of what you'll find: - -**Genmedia Creative Studio v.Next:** The [the next generation](./experiments/veo-app/) of the creative studio application. - -[![GenMedia Creative Studio v.next](https://github.com/user-attachments/assets/1ff8ccdc-48b1-4c8b-8851-925104fdd41a)](./experiments/veo-app/) - -**Combined Workflows** -* **Countdown Workflow:** An automated two-stage pipeline to create branded countdown videos. -* **Storycraft:** An AI-powered video storyboard generation platform that transforms text descriptions into complete video narratives. -* **Creative GenMedia Workflow:** An end-to-end workflow to produce high-quality, on-brand creative media. - -**Prompting Techniques** -* **Promptlandia:** A powerful web app to analyze, refine, and improve your prompts. -* **Veo Genetic Prompt Optimizer:** An automated system to evolve and refine high-level "metaprompts" for Veo. -* **Character & Item Consistency:** Workflows for maintaining consistency for characters and items across video scenes. - -**Image Generation & Analysis** -* **Virtual Try-On:** A notebook for virtually trying on outfits at scale. -* **Imagen Product Recontextualization:** Tools for large-scale product image recontextualization. -* **Arena:** A visual arena for rating and comparing images from different models. - -**Audio & Video** -* **MCP Tools for Genmedia:** Model Context Protocol servers for Veo, Imagen, Lyria, and Chirp. -* **Creative Podcast Assistant:** A notebook for creating a podcast with generative media. -* **Babel:** An experimental app for Chirp 3 HD voices. - -...and much more! For a full, detailed list of all experiments, please see the [Experiments README](./experiments/README.md). - -## GenMedia | Creative Studio - -![](./screenshots/creative_studio_02.png) - - - -## Run locally - -Two environment variables are required to run this application: - -`PROJECT_ID` -Provide an environment variable for your Google Cloud Project ID - -``` -export PROJECT_ID=$(gcloud config get project) -``` - -`IMAGE_CREATION_BUCKET` -You'll need Google Cloud Storage bucket for the generative media. Note that this has to exist prior to running the application. - -If an existing Google Cloud Storage bucket is available, please provide its name without the `"gs://"` prefix. - -``` -export IMAGE_CREATION_BUCKET=$PROJECT_ID-genmedia -``` - -Otherwise, follow the next steps to create a storage bucket. - -### Create Storage Bucket (Optional) - -Please run the following command to obtain new credentials. - -``` -gcloud auth login -``` - -If you have already logged in with a different account, run: - -``` -gcloud config set account $PROJECT_ID -``` - -Create the storage bucket. - -``` -gcloud storage buckets create gs://$IMAGE_CREATION_BUCKET --location=US --default-storage-class=STANDARD -``` - -> **NOTE:** We have provided a `env_template` that you can use to in your development environment. Simply duplicate it, rename it to `.env` and replace `` with your project ID. - -Then run `source .env` to add those variables into your environment. - - -### Create Virtual Environment - -Create and activate a virtual environment for your solution. -``` -python3 -m venv venv -source venv/bin/activate -``` - -### Install requirements - -Install the required Python libraries. - -``` -pip install -r requirements.txt -``` - -### Run with mesop - -To run locally, use the `mesop` command and open the browser to the URL provided: - -``` -mesop main.py -``` - -> **NOTE:** The mesop application may request you to allow it to accept incoming network connections. Please accept to avoid limiting the application's behavior. - - -## Deploy to Cloud Run - -Deploy this application to a Cloud Run service. - -It's recommended that you create a separate service account to deploy a Cloud Run Service. - - -``` -export SA_NAME=sa-genmedia-creative-studio -export PROJECT_ID=$(gcloud config get project) - -gcloud iam service-accounts create $SA_NAME --description="genmedia creative studio" --display-name="$SA_NAME" - -gcloud projects add-iam-policy-binding $PROJECT_ID --member="serviceAccount:$SA_NAME@$PROJECT_ID.iam.gserviceaccount.com" --role="roles/aiplatform.user" - -gcloud projects add-iam-policy-binding $PROJECT_ID --member="serviceAccount:$SA_NAME@$PROJECT_ID.iam.gserviceaccount.com" --role="roles/storage.objectUser" -``` - -Deploy with the service account and environment variables created above; `PROJECT_ID` and `IMAGE_CREATION_BUCKET`. - -``` -gcloud run deploy creative-studio --source . \ - --allow-unauthenticated --region us-central1 \ - --service-account $SA_NAME@$PROJECT_ID.iam.gserviceaccount.com \ - --update-env-vars=IMAGE_CREATION_BUCKET=$IMAGE_CREATION_BUCKET,PROJECT_ID=$PROJECT_ID -``` - -# Disclaimer - -This is not an officially supported Google product. diff --git a/archive/imagen-creative-studio/config/__init__.py b/archive/imagen-creative-studio/config/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/archive/imagen-creative-studio/config/default.py b/archive/imagen-creative-studio/config/default.py deleted file mode 100644 index c53c92d78..000000000 --- a/archive/imagen-creative-studio/config/default.py +++ /dev/null @@ -1,101 +0,0 @@ -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" Default Configuration for Creative Studio """ - -import os -from dataclasses import dataclass, field -from vertexai.generative_models import HarmBlockThreshold - -from models.image_models import ImageModel - - -@dataclass -class GeminiModelConfig: - """Configuration specific to Gemini models.""" - - generation: dict = field(default_factory=dict) - safety_settings: dict = field(default_factory=dict) - tools: dict = field(default_factory=dict) - grounding_source: object = None - - def __repr__(self): - params = [] - for k, v in self.generation.items(): - params.append(f"generation_{k}={v}") - for k, v in self.safety_settings.items(): - params.append(f"safety_{k}={v}") - for k, v in self.tools.items(): - params.append(f"tools_{k}={v}") - if self.grounding_source: - params.append("grounding=ON") - return f"ModelConfig({', '.join(params)})" - - -@dataclass -class Config: - """All configuration variables for this solution should be managed here.""" - - TITLE = "IMAGEN CREATIVE STUDIO" - IMAGE_CREATION_BUCKET = os.environ.get("IMAGE_CREATION_BUCKET", "") - PROJECT_ID = os.environ.get("PROJECT_ID", "") - LOCATION = os.getenv("LOCATION", "us-central1") - MODEL_GEMINI_MULTIMODAL = "gemini-2.5-flash" - MODEL_IMAGEN2 = "imagegeneration@006" - MODEL_IMAGEN_NANO = "imagegeneration@004" - MODEL_IMAGEN3_FAST = "imagen-3.0-fast-generate-00" - MODEL_IMAGEN3 = "imagen-3.0-generate-002" - TEMPERATURE = 0.8 - TOP_P = 0.97 - TOP_K = 40 - MAX_OUTPUT_TOKENS = 2048 - IMAGEN_PROMPTS_JSON = "prompts/imagen_prompts.json" - image_modifiers: list[str] = field( - default_factory=lambda: [ - "aspect_ratio", - "content_type", - "color_tone", - "lighting", - "composition", - ] - ) - gemini_settings: GeminiModelConfig = field( - default_factory=GeminiModelConfig, init=False - ) - display_image_models: list[ImageModel] = field( - default_factory=lambda: [ - {"display": "Imagen 3 Fast", "model_name": Config.MODEL_IMAGEN3_FAST}, - {"display": "Imagen 3", "model_name": Config.MODEL_IMAGEN3}, - ] - ) - - def __post_init__(self): - """Initialize fields that depend on other fields or require complex logic.""" - self.gemini_settings.generation["temperature"] = self.TEMPERATURE - self.gemini_settings.generation["top_p"] = self.TOP_P - self.gemini_settings.generation["top_k"] = self.TOP_K - self.gemini_settings.generation["max_output_tokens"] = self.MAX_OUTPUT_TOKENS - self.gemini_settings.generation["candidate_count"] = 1 - self.gemini_settings.generation["stop_sequences"] = [] - self.gemini_settings.safety_settings["HARASSMENT"] = ( - HarmBlockThreshold.BLOCK_ONLY_HIGH - ) - self.gemini_settings.safety_settings["HATE_SPEECH"] = ( - HarmBlockThreshold.BLOCK_ONLY_HIGH - ) - self.gemini_settings.safety_settings["SEXUALLY_EXPLICIT"] = ( - HarmBlockThreshold.BLOCK_ONLY_HIGH - ) - self.gemini_settings.safety_settings["DANGEROUS_CONTENT"] = ( - HarmBlockThreshold.BLOCK_ONLY_HIGH - ) diff --git a/archive/imagen-creative-studio/env_template b/archive/imagen-creative-studio/env_template deleted file mode 100644 index ef741b6c6..000000000 --- a/archive/imagen-creative-studio/env_template +++ /dev/null @@ -1,2 +0,0 @@ -export PROJECT_ID="" -export IMAGE_CREATION_BUCKET="${PROJECT_ID}-genmedia" \ No newline at end of file diff --git a/archive/imagen-creative-studio/main.py b/archive/imagen-creative-studio/main.py deleted file mode 100644 index eb30ef465..000000000 --- a/archive/imagen-creative-studio/main.py +++ /dev/null @@ -1,748 +0,0 @@ -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" Main Mesop App """ -import json -import random -from dataclasses import dataclass, field - -import mesop as me -import vertexai -from google.cloud.aiplatform import telemetry -from vertexai.generative_models import ( - GenerationConfig, - GenerativeModel, - HarmCategory, - Part, -) -from vertexai.preview.vision_models import ImageGenerationModel -from models.image_models import ImageModel -from config.default import Config -from prompts.critics import ( - MAGAZINE_EDITOR_PROMPT, - REWRITER_PROMPT, -) -from svg_icon.svg_icon_component import svg_icon_component - -# Initialize Configuration -cfg = Config() -vertexai.init(project=cfg.PROJECT_ID, location=cfg.LOCATION) - -@dataclass -@me.stateclass -class State: - """Mesop App State""" - - # Image generation model selection and output - image_models: list[ImageModel] = field(default_factory=lambda: cfg.display_image_models.copy()) - image_output: list[str] = field(default_factory=list) - image_commentary: str = "" - image_model_name: str = cfg.MODEL_IMAGEN3_FAST - - # General UI state - is_loading: bool = False - show_advanced: bool = False - - # Image prompt and related settings - image_prompt_input: str = "" - image_prompt_placeholder: str = "" - image_textarea_key: int = 0 - - image_negative_prompt_input: str = "" - image_negative_prompt_placeholder: str = "" - image_negative_prompt_key: int = 0 # Or handle None later - - # Image generation parameters - imagen_watermark: bool = True - imagen_seed: int = 0 - imagen_image_count: int = 3 - - # Image style modifiers - image_content_type: str = "Photo" - image_color_tone: str = "Cool tone" - image_lighting: str = "Golden hour" - image_composition: str = "Wide angle" - image_aspect_ratio: str = "1:1" - - -def on_image_input(e: me.InputEvent): - """Image Input Event""" - state = me.state(State) - state.image_prompt_input = e.value - - -def on_blur_image_prompt(e: me.InputBlurEvent): - """Image Blur Event""" - me.state(State).image_prompt_input = e.value - - -def on_blur_image_negative_prompt(e: me.InputBlurEvent): - """Image Blur Event""" - me.state(State).image_negative_prompt_input = e.value - - -def on_click_generate_images(e: me.ClickEvent): - """Click Event to generate images.""" - state = me.state(State) - state.is_loading = True - state.image_output.clear() - yield - generate_images(state.image_prompt_input) - generate_compliment(state.image_prompt_input) - state.is_loading = False - yield - - -def on_select_image_count(e: me.SelectSelectionChangeEvent): - """Change Event For Selecting an Image Model.""" - state = me.state(State) - setattr(state, e.key, e.value) - - -def generate_images(input_txt: str): - """Generate Images""" - state = me.state(State) - - # handle condition where someone hits "random" but doens't modify - if not input_txt and state.image_prompt_placeholder: - input_txt = state.image_prompt_placeholder - state.image_output.clear() - modifiers = [] - for mod in cfg.image_modifiers: - if mod != "aspect_ratio": - if getattr(state, f"image_{mod}") != "None": - modifiers.append(getattr(state, f"image_{mod}")) - prompt_modifiers = ", ".join(modifiers) - prompt = f"{input_txt} {prompt_modifiers}" - print(f"prompt: {prompt}") - if state.image_negative_prompt_input: - print(f"negative prompt: {state.image_negative_prompt_input}") - print(f"model: {state.image_model_name}") - image_generation_model = ImageGenerationModel.from_pretrained( - state.image_model_name - ) - response = image_generation_model.generate_images( - prompt=prompt, - add_watermark=True, - aspect_ratio=getattr(state, "image_aspect_ratio"), - number_of_images=int(state.imagen_image_count), - output_gcs_uri=f"gs://{cfg.IMAGE_CREATION_BUCKET}", - language="auto", - negative_prompt=state.image_negative_prompt_input, - ) - for idx, img in enumerate(response): - print( - f"generated image: {idx} size: {len(img._as_base64_string())} at {img._gcs_uri}" - ) - state.image_output.append(img._gcs_uri) # type: ignore - - -def random_prompt_generator(e: me.ClickEvent): - """Click Event to generate a random prompt from a list of predefined prompts.""" - state = me.state(State) - with open(cfg.IMAGEN_PROMPTS_JSON, "r", encoding="utf-8") as file: - data = file.read() - prompts = json.loads(data) - random_prompt = random.choice(prompts["imagen"]) - state.image_prompt_placeholder = random_prompt - on_image_input( - me.InputEvent(key=str(state.image_textarea_key), value=random_prompt) - ) - print(f"preset chosen: {random_prompt}") - yield - - -# advanced controls -def on_click_advanced_controls(e: me.ClickEvent): - """Click Event to toggle advanced controls.""" - me.state(State).show_advanced = not me.state(State).show_advanced - - -def on_click_clear_images(e: me.ClickEvent): - """Click Event to clear images.""" - state = me.state(State) - state.image_prompt_input = "" - state.image_prompt_placeholder = "" - state.image_output.clear() - state.image_negative_prompt_input = "" - state.image_textarea_key += 1 - state.image_negative_prompt_key += 1 - - -def on_selection_change_image(e: me.SelectSelectionChangeEvent): - """Change Event For Selecting an Image Model.""" - state = me.state(State) - print(f"changed: {e.key}={e.value}") - setattr(state, f"image_{e.key}", e.value) - - -def on_click_rewrite_prompt(e: me.ClickEvent): - """Click Event to rewrite prompt.""" - state = me.state(State) - if state.image_prompt_input: - rewritten = rewrite_prompt(state.image_prompt_input) - state.image_prompt_input = rewritten - state.image_prompt_placeholder = rewritten - - -def rewrite_prompt(original_prompt: str): - """ - Outputs a rewritten prompt - - Args: - original_prompt (str): artists's original prompt - """ - # state = me.state(State) - with telemetry.tool_context_manager("creative-studio"): - rewriting_model = GenerativeModel(cfg.MODEL_GEMINI_MULTIMODAL) - model_config = cfg.gemini_settings - generation_cfg = GenerationConfig( - temperature=model_config.generation["temperature"], - max_output_tokens=model_config.generation["max_output_tokens"], - ) - safety_filters = { - HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT: model_config.safety_settings[ - "DANGEROUS_CONTENT" - ], - HarmCategory.HARM_CATEGORY_HATE_SPEECH: model_config.safety_settings[ - "HATE_SPEECH" - ], - HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT: model_config.safety_settings[ - "SEXUALLY_EXPLICIT" - ], - HarmCategory.HARM_CATEGORY_HARASSMENT: model_config.safety_settings[ - "HARASSMENT" - ], - } - response = rewriting_model.generate_content( - REWRITER_PROMPT.format(original_prompt), - generation_config=generation_cfg, - safety_settings=safety_filters, - ) - print(f"asked to rewrite: '{original_prompt}") - print(f"rewritten as: {response.text}") - return response.text - - -def generate_compliment(generation_instruction: str): - """ - Outputs a Gemini generated comment about images - """ - state = me.state(State) - with telemetry.tool_context_manager("creative-studio"): - generation_model = GenerativeModel(cfg.MODEL_GEMINI_MULTIMODAL) - model_config = cfg.gemini_settings - generation_cfg = GenerationConfig( - temperature=model_config.generation["temperature"], - max_output_tokens=model_config.generation["max_output_tokens"], - ) - safety_filters = { - HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT: model_config.safety_settings[ - "DANGEROUS_CONTENT" - ], - HarmCategory.HARM_CATEGORY_HATE_SPEECH: model_config.safety_settings[ - "HATE_SPEECH" - ], - HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT: model_config.safety_settings[ - "SEXUALLY_EXPLICIT" - ], - HarmCategory.HARM_CATEGORY_HARASSMENT: model_config.safety_settings[ - "HARASSMENT" - ], - } - prompt_parts = [] - for idx, img in enumerate(state.image_output): - # not bytes - # prompt_parts.append(Part.from_data(data=img, mime_type="image/png")) - # now gcs uri - prompt_parts.append(f"""image {idx+1}""") - prompt_parts.append(Part.from_uri(uri=img, mime_type="image/png")) - prompt_parts.append(MAGAZINE_EDITOR_PROMPT.format(generation_instruction)) - response = generation_model.generate_content( - prompt_parts, - generation_config=generation_cfg, - safety_settings=safety_filters, - ) - state.image_commentary = response.text - - -@me.page( - path="/", - security_policy=me.SecurityPolicy( - allowed_script_srcs=["https://cdn.jsdelivr.net"], - allowed_connect_srcs=["https://cdn.jsdelivr.net"], - dangerously_disable_trusted_types=True, - ), - title="Imagen Creative Studio | Vertex AI", -) -def app(): - """Mesop App""" - state = me.state(State) - with me.box( - style=me.Style( - display="flex", - flex_direction="column", - height="100%", - ), - ): - with me.box( - style=me.Style( - background="#f0f4f8", - height="100%", - overflow_y="scroll", - margin=me.Margin(bottom=20), - ) - ): - with me.box( - style=me.Style( - background="#f0f4f8", - padding=me.Padding(top=24, left=24, right=24, bottom=24), - display="flex", - flex_direction="column", - ) - ): - with me.box( - style=me.Style( - display="flex", - justify_content="space-between", - ) - ): - with me.box( - style=me.Style(display="flex", flex_direction="row", gap=5) - ): - me.icon(icon="auto_fix_high") - me.text( - cfg.TITLE, - type="headline-5", - style=me.Style(font_family="Google Sans"), - ) - image_model_options = [] - for c in state.image_models: - image_model_options.append( - me.SelectOption( - label=c.get("display"), value=c.get("model_name") - ) - ) - me.select( - label="Imagen version", - options=image_model_options, - key="model_name", - on_selection_change=on_selection_change_image, - value=state.image_model_name, - ) - - # Prompt - with me.box( - style=me.Style( - margin=me.Margin(left="auto", right="auto"), - width="min(1024px, 100%)", - gap="24px", - flex_grow=1, - display="flex", - flex_wrap="wrap", - flex_direction="column", - ) - ): - with me.box(style=_BOX_STYLE): - me.text( - "Prompt for image generation", - style=me.Style(font_weight=500), - ) - me.box(style=me.Style(height=16)) - me.textarea( - key=str(state.image_textarea_key), - # on_input=on_image_input, - on_blur=on_blur_image_prompt, - rows=3, - autosize=True, - max_rows=10, - style=me.Style(width="100%"), - value=state.image_prompt_placeholder, - ) - # Prompt buttons - me.box(style=me.Style(height=12)) - with me.box( - style=me.Style( - display="flex", justify_content="space-between" - ) - ): - me.button( - "Clear", - color="primary", - type="stroked", - on_click=on_click_clear_images, - ) - - me.button( - "Random", - color="primary", - type="stroked", - on_click=random_prompt_generator, - style=me.Style(color="#1A73E8"), - ) - # prompt rewriter - # disabled = not state.image_prompt_input if not state.image_prompt_input else False - with me.content_button( - on_click=on_click_rewrite_prompt, - type="stroked", - # disabled=disabled, - ): - with me.tooltip(message="rewrite prompt with Gemini"): - with me.box( - style=me.Style( - display="flex", - gap=3, - align_items="center", - ) - ): - me.icon("auto_awesome") - me.text("Rewriter") - # generate - me.button( - "Generate", - color="primary", - type="flat", - on_click=on_click_generate_images, - ) - - # Modifiers - with me.box(style=_BOX_STYLE): - with me.box( - style=me.Style( - display="flex", - justify_content="space-between", - gap=2, - width="100%", - ) - ): - if state.show_advanced: - with me.content_button( - on_click=on_click_advanced_controls - ): - with me.tooltip(message="hide advanced controls"): - with me.box(style=me.Style(display="flex")): - me.icon("expand_less") - else: - with me.content_button( - on_click=on_click_advanced_controls - ): - with me.tooltip(message="show advanced controls"): - with me.box(style=me.Style(display="flex")): - me.icon("expand_more") - - # Default Modifiers - me.select( - label="Aspect Ratio", - options=[ - me.SelectOption(label="1:1", value="1:1"), - me.SelectOption(label="3:4", value="3:4"), - me.SelectOption(label="4:3", value="4:3"), - me.SelectOption(label="16:9", value="16:9"), - me.SelectOption(label="9:16", value="9:16"), - ], - key="aspect_ratio", - on_selection_change=on_selection_change_image, - style=me.Style(width="160px"), - value=state.image_aspect_ratio, - ) - me.select( - label="Content Type", - options=[ - me.SelectOption(label="None", value="None"), - me.SelectOption(label="Photo", value="Photo"), - me.SelectOption(label="Art", value="Art"), - ], - key="content_type", - on_selection_change=on_selection_change_image, - style=me.Style(width="160px"), - value=state.image_content_type, - ) - - color_and_tone_options = [] - for c in [ - "None", - "Black and white", - "Cool tone", - "Golden", - "Monochromatic", - "Muted color", - "Pastel color", - "Toned image", - ]: - color_and_tone_options.append( - me.SelectOption(label=c, value=c) - ) - me.select( - label="Color & Tone", - options=color_and_tone_options, - key="color_tone", - on_selection_change=on_selection_change_image, - style=me.Style(width="160px"), - value=state.image_color_tone, - ) - - lighting_options = [] - for l in [ - "None", - "Backlighting", - "Dramatic light", - "Golden hour", - "Long-time exposure", - "Low lighting", - "Multiexposure", - "Studio light", - "Surreal lighting", - ]: - lighting_options.append( - me.SelectOption(label=l, value=l) - ) - me.select( - label="Lighting", - options=lighting_options, - key="lighting", - on_selection_change=on_selection_change_image, - value=state.image_lighting, - ) - - composition_options = [] - for c in [ - "None", - "Closeup", - "Knolling", - "Landscape photography", - "Photographed through window", - "Shallow depth of field", - "Shot from above", - "Shot from below", - "Surface detail", - "Wide angle", - ]: - composition_options.append( - me.SelectOption(label=c, value=c) - ) - me.select( - label="Composition", - options=composition_options, - key="composition", - on_selection_change=on_selection_change_image, - value=state.image_composition, - ) - - # Advanced controls - # negative prompt - with me.box( - style=me.Style( - display="flex", - flex_direction="row", - gap=5, - ) - ): - if state.show_advanced: - me.box(style=me.Style(width=67)) - me.input( - label="negative phrases", - on_blur=on_blur_image_negative_prompt, - value=state.image_negative_prompt_placeholder, - key=str(state.image_negative_prompt_key), - style=me.Style( - width="350px", - ), - ) - me.select( - label="number of images", - value="3", - options=[ - me.SelectOption(label="1", value="1"), - me.SelectOption(label="2", value="2"), - me.SelectOption(label="3", value="3"), - me.SelectOption(label="4", value="4"), - ], - on_selection_change=on_select_image_count, - key="imagen_image_count", - style=me.Style(width="155px"), - ) - me.checkbox( - label="watermark", - checked=True, - disabled=True, - key="imagen_watermark", - ) - me.input( - label="seed", - disabled=True, - key="imagen_seed", - ) - - # Image output - with me.box(style=_BOX_STYLE): - me.text("Output", style=me.Style(font_weight=500)) - if state.is_loading: - with me.box( - style=me.Style( - display="grid", - justify_content="center", - justify_items="center", - ) - ): - me.progress_spinner() - if len(state.image_output) != 0: - with me.box( - style=me.Style( - display="grid", - justify_content="center", - justify_items="center", - ) - ): - # Generated images row - with me.box( - style=me.Style( - flex_wrap="wrap", display="flex", gap="15px" - ) - ): - for _, img in enumerate(state.image_output): - # print(f"{idx}: {len(img)}") - img_url = img.replace( - "gs://", - "https://storage.mtls.cloud.google.com/", - ) - me.image( - # src=f"data:image/png;base64,{img}", - src=f"{img_url}", - style=me.Style( - width="300px", - margin=me.Margin(top=10), - border_radius="35px", - ), - ) - - # SynthID notice - with me.box( - style=me.Style( - display="flex", - flex_direction="row", - align_items="center", - ) - ): - svg_icon_component( - svg="""""" - ) - - me.text( - text="images watermarked by SynthID", - style=me.Style( - padding=me.Padding.all(10), - font_size="0.95em", - ), - ) - else: - if state.is_loading: - me.text( - text="generating images!", - style=me.Style( - display="grid", - justify_content="center", - padding=me.Padding.all(20), - ), - ) - else: - me.text( - text="generate some images!", - style=me.Style( - display="grid", - justify_content="center", - padding=me.Padding.all(20), - ), - ) - - # Image commentary - if len(state.image_output) != 0: - with me.box(style=_BOX_STYLE): - with me.box( - style=me.Style( - display="flex", - justify_content="space-between", - gap=2, - width="100%", - ) - ): - with me.box( - style=me.Style( - flex_wrap="wrap", - display="flex", - flex_direction="row", - # width="85%", - padding=me.Padding.all(10), - ) - ): - me.icon("assistant") - me.text( - "magazine editor", - style=me.Style(font_weight=500), - ) - me.markdown( - text=state.image_commentary, - style=me.Style(padding=me.Padding.all(15)), - ) - - footer() - - -def footer(): - """Creates the footer of the application""" - with me.box( - style=me.Style( - # height="18px", - padding=me.Padding(left=20, right=20, top=10, bottom=14), - border=me.Border( - top=me.BorderSide(width=1, style="solid", color="$ececf1") - ), - display="flex", - justify_content="space-between", - flex_direction="row", - color="rgb(68, 71, 70)", - letter_spacing="0.1px", - line_height="14px", - font_size=14, - font_family="Google Sans", - ) - ): - me.html( - "Imagen", - ) - me.html( - "Imagen Prompting Guide" - ) - me.html( - "Imagen Responsible AI" - ) - - -_BOX_STYLE = me.Style( - flex_basis="max(480px, calc(50% - 48px))", - background="#fff", - border_radius=12, - box_shadow=("0 3px 1px -2px #0003, 0 2px 2px #00000024, 0 1px 5px #0000001f"), - padding=me.Padding(top=16, left=16, right=16, bottom=16), - display="flex", - flex_direction="column", -) - -_BOX_STYLE_ROW = me.Style( - flex_basis="max(480px, calc(50% - 48px))", - background="#fff", - border_radius=12, - box_shadow=("0 3px 1px -2px #0003, 0 2px 2px #00000024, 0 1px 5px #0000001f"), - padding=me.Padding(top=12, left=12, right=12, bottom=12), - display="flex", - flex_direction="row", -) diff --git a/archive/imagen-creative-studio/models/__init__.py b/archive/imagen-creative-studio/models/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/archive/imagen-creative-studio/models/image_models.py b/archive/imagen-creative-studio/models/image_models.py deleted file mode 100644 index 7f01f99b4..000000000 --- a/archive/imagen-creative-studio/models/image_models.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" Image Models type definitions """ -from typing import TypedDict - - -class ImageModel(TypedDict): - """Defines Models For Image Generation.""" - - display: str - model_name: str diff --git a/archive/imagen-creative-studio/prompts/__init__.py b/archive/imagen-creative-studio/prompts/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/archive/imagen-creative-studio/prompts/critics.py b/archive/imagen-creative-studio/prompts/critics.py deleted file mode 100644 index cc50b20e2..000000000 --- a/archive/imagen-creative-studio/prompts/critics.py +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -MAGAZINE_EDITOR_PROMPT = """ - -You're a friendly visual magazine editor who loves AI generated images with Imagen 3, Google's latest image generation model whose quality exceeds all leading external competitors in aesthetics, defect-free, and text image alignment. You are always friendly and positive and not shy to provide critiques with delightfully cheeky, clever streak. You've been presented with these images for your thoughts. - -The prompt used by the author to create these images was: "{}" - -Create a few sentence critique and commentary (3-4 sentences) complimenting each these images individually and together, paying special attention to quality of each image such calling out anything you notice in these following areas: -* Alignment with prompt - how well each image mached the given text prompt -* Photorealism - how closely the image resembles the type of image requested to be generated -* Detail - the level of detail and overall clarity -* Defects - any visible artifacts, distortions, or errors - -Include aesthetic qualities (come up with a score). Include commentary on color, tone, subject, lighting, and composition. You may address the author as "you." - -""" - - -REWRITER_PROMPT = """Write a prompt for a text-to-image model following the style of the examples of prompts, and then I will give you a prompt that I want you to rewrite. - -Examples of prompts: - -A close-up of a sleek Siamese cat perched regally, in front of a deep purple background, in a high-resolution photograph with fine details and color grading. -Flat vector illustration of "Breathe deep" hand-lettering with floral and leaf decorations. Bright colors, simple lines, and a cute, minimalist design on a white background. -Long exposure photograph of rocks and sea, long shot of cloudy skies, golden hour at the rocky shore with reflections in the water. High resolution. -Three women stand together laughing, with one woman slightly out of focus in the foreground. The sun is setting behind the women, creating a lens flare and a warm glow that highlights their hair and creates a bokeh effect in the background. The photography style is candid and captures a genuine moment of connection and happiness between friends. The warm light of golden hour lends a nostalgic and intimate feel to the image. -A group of five friends are standing together outdoors with tall gray mountains in the background. One woman is wearing a black and white striped top and is laughing with her hand on her mouth. The man next to her is wearing a blue and green plaid shirt, khaki shorts, and a camera around his neck, he is laughing and has his arm around another man who is bent over laughing wearing a gray shirt and black pants with a camera around his neck. Behind them, a blonde woman with sunglasses on her head and wearing a beige top and red backpack is laughing and pushing the man in the gray shirt. -An elderly woman with gray hair is sitting on a park bench next to a medium-sized brown and white dog, with the sun setting behind them, creating a warm orange glow and lens flare. She is wearing a straw sun hat and a pink patterned jacket and has a peaceful expression as she looks off into the distance. -A woman with blonde hair wearing sunglasses stands amidst a dazzling display of golden bokeh lights. Strands of lights and crystals partially obscure her face, and her sunglasses reflect the lights. The light is low and warm creating a festive atmosphere and the bright reflections in her glasses and the bokeh. This is a lifestyle portrait with elements of fashion photography. -A closeup of an intricate, dew-covered flower in the rain. The focus is on the delicate petals and water droplets, capturing their soft pastel colors against a dark blue background. Shot from eye level using natural light to highlight the floral texture and dew's glistening effect. This image conveys the serene beauty found within nature's miniature worlds in the style of realist details -A closeup of a pair of worn hands, wrinkled and weathered, gently cupping a freshly baked loaf of bread. The focus is on the contrast between the rough hands and the soft dough, with flour dusting the scene. Warm light creates a sense of nourishment and tradition in the style of realistic details -A Dalmatian dog in front of a pink background in a full body dynamic pose shot with high resolution photography and fine details isolated on a plain stock photo with color grading in the style of a hyper realistic style -A massive spaceship floating above an industrial city, with the lights of thousands of buildings glowing in the dusk. The atmosphere is dark and mysterious, in the cyberpunk style, and cinematic -An architectural photograph of an interior space made from interwoven, organic forms and structures inspired in the style of coral reefs and patterned textures. The scene is bathed in the warm glow of natural light, creating intricate shadows that accentuate the fluidity and harmony between the different elements within the design - -Prompt to rewrite: - -'{}' - -Don’t generate images, provide only the rewritten prompt. -""" \ No newline at end of file diff --git a/archive/imagen-creative-studio/prompts/imagen_prompts.json b/archive/imagen-creative-studio/prompts/imagen_prompts.json deleted file mode 100644 index 4237f26d3..000000000 --- a/archive/imagen-creative-studio/prompts/imagen_prompts.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "imagen": [ - "A studio photo of five scientists standing around an engineering device and discussing their latest discovery, natural bright lighting, eye level lens, people dressed in business casuals clothes, Canon", - "a photo of a young woman and her dog at the park, the woman wears a green blouse, the dog is a small yorkie and has a green collar, the woman smiles and faces the camera, a lake can be seen in the background, natural lightning", - "A close up image of four pairs of hands on a table", - "A polaroid capture of three friends happy on the car bonnet, late 1960s america, flash photography", - "a polaroid capture of high school friends happy on the car bonnet, late 1960s america, flash photography", - "a recreation of the oil painting The Meeting Fox Hunt Scene where spider-man is riding the horse", - "Contrast with huge height difference, a person looks upon a massive cloud, extremely detailed still from, hyper textured, anime style", - "in a white bowl in a sunlit kitchen, a close-up photo showcases a heaping pile of golden-brown Homemade French Fries, crisply cooked in an Air Fryer. The high-resolution image captures the inviting texture and glistening oils, highlighting the perfect combination of fluffy insides and crunchy exteriors. Steam gently rises from the fries, filling the frame with a sense of warmth and anticipation.", - "An old woman but super modern and cool, her is smiling and wearing yellow modern and nice clothes, using her high-tech cellphone to take selfie in her beautiful garden, happy atmosphere, high resolution", - "A polaroid capture of three friends happy on the car bonnet, late 1960s america, flash photography", - "a photorealistic image of a woman’s hand reaching up to touch a dandelion seed head, a field of dandelions stretching to the horizon, with the phrase 'Sometimes letting go is the bravest act' written in delicate cursive above the hand", - "artist painting", - "A Real-Cola bottle showing the Real-Cola logo with a blue sticker with the text: \"Happy Halloween\"", - "From a rooftop garden, a group of urban farmers, their hands caked in soil, proudly harvest their bountiful crops, the cityscape stretching out behind them like a vibrant tapestry on a sunny day", - "a card for a university graduate, says \"Congratulations new grad!\" on the cover, with a cute cartoon of a young adult wearing graduation robes, in a fun playful color and design", - "a card for a university graduate, says \"new grad\" on the cover, with a cute cartoon of a young adult wearing graduation robes, in a fun playful color and design", - "A hiker during a late spring day in California’s Big Sur overlooking the ocean", - "a family of four sitting at the couch watching tv with their dog", - "A photo of 3 friends hiking in hawaii near a beach in the mid afternoon", - "design for a card for new weds, says \"Congratulations Mila and Miko\" on the cover, with a cute cartoon a couple, in fun playful color and design. Mila has brown hair with green eyes wearing a pink dress and carrying a bouquet of lily's. Miko has blue eyes, tan skin and short hair - he is wearing a blue suit", - "In a sun-drenched open-air kitchen, a group of friends, their laughter echoing through the space, prepare a vibrant feast together, their hands stained with the colors of fresh herbs and spices.", - "four friends (two men and two women) at the pyramids of Giza, the men are wearing polo shirts with khakhi shorts while the women are wearing floral dresses. They are all wearing sunglasses, and straw hats. Harsh direct sunlight, in the style of a travel photo", - "four friends (two men and two women) at the steps under the pyramid of Giza, the men are wearing polo shirts with khakhi shorts while the women are wearing floral dresses. They are all wearing sunglasses, and straw hats. Harsh direct sunlight, in the style of a travel photo", - "close up shot, In a dimly lit jazz club, a soulful saxophone player, their face contorted in concentration, pours their heart out through their music. A small group of people listen intently, feeling every emotion", - "In a bustling newsroom, a team of journalists, their eyes glued to computer screens, race against the clock to break a major story, their fingers flying across keyboards as they craft compelling narratives.", - "a rembrandt painting of a clean shaven 36 year old male with short light strawberry brown hair", - "Isometric drawing of the ocean featuring marine animals like fish, dolphins. Displaying different levels of seabed. Penguins and polar bears stand on the top iceberg, with a theme of ocean conservation, surrealism, and a dreamy blue background", - "Graffiti art style poster, stylized cartoon style, a vintage car on a busy street, low angle, car reflection visible on a puddle in the street, dirty, grungy", - "a modern and bright Tuscan villa, into which the sun shines and sparkles. natural green and grey colors. modern interior that inspires with freshness, light and playfulness, architecture photography, simple view, minimalism", - "Mock up of a modern dining room interior design, creative, dreamy aesthetic", - "architectural photography, a small grill on a minimalist concrete surface, modern design, sharp details, ambient light, shadows, ultra-realistic texture", - "Stock photo of a person sailing on a calm sea with a beautiful sunset for advertisement, well-composed, well-lit, in focus, with good resolution and clarity", - "ferrari Formula one car, side angle, photo realistic, hyper real, black background, sharp lighting, dramatic photography", - "a spacious personal office in a luxury home, floor to ceiling windows, dim natural light, covered in plants, a rainy forest view, embodies serenity, peace", - "professional photograph of a high end scotch whiskey “Imagen” presented on the table, eye level, warm cinematic,", - "A stock photograph of two friends having coffee with a bustling café as the background context, during the early afternoon with warm, ambient lighting and shot with a wide-angle lens", - "iconic idol, flat vector, groovy neon lo lo-fi, isolated on a white background, surrounded by circle", - "A serene lakeside scene at sunset with visible brushwork. Impasto texture and chiaroscuro lighting, emulating the style of a classical oil painting", - "ऊपर से देखा गया किताबों का ढेर। सबसे ऊपरी पुस्तक में एक पक्षी का जलरंग चित्रण है। किताब पर VERTEX AI मोटे अक्षरों में लिखा हुआ है", - "어두운 노란색과 청록색으로 이루어진 밝은 색의 옷을입고 귀걸이를 끼고있는 여자 포스트 모던 패션 사진", - "A large, colorful bouquet of flowers in an old blue glass vase on the table. In front is one beautiful peony flower surrounded by various other blossoms like roses, lilies, daisies, orchids, fruits, berries, green leaves. The background is dark gray. Oil painting in the style of the Dutch Golden Age.", - "Detailed illustration of majestic lion roaring proudly in a dream-like jungle, purple white line art background, clipart on light violet paper texture", - "Claymation scene. A medium wide shot of an elderly woman. She is wearing flowing clothing. She is standing in a lush garden watering the plants with an orange watering can", - "Elephant amigurumi walking in savanna, a professional photograph, blurry background", - "A view of a person's hand as they hold a little clay figurine of a bird in their hand and sculpt it with a modeling tool in their other hand. You can see the sculptor's scarf. Their hands are covered in clay dust. a macro DSLR image highlighting the texture and craftsmanship.", - "White fluffy bear toy is sleeping in a children's room, on the floor of a baby bedroom with toy boxes and toys around, in the style of photorealistic 3D rendering.", - "Word \"light\" made from various colorful feathers, black background", - "A single comic book panel of a boy and his father on a grassy hill, staring at the sunset. A speech bubble points from the boy's mouth and says: The sun will rise again. Muted, late 1990s coloring style", - "A photograph of a stately library entrance with the words \"Central Library\" carved into the stone", - "Shot in the style of DSLR camera with the polarizing filter. A photo of two hot air balloons floating over the unique rock formations in Cappadocia, Turkey. The colors and patterns on these balloons contrast beautifully against the earthy tones of the landscape below. This shot captures the sense of adventure that comes with enjoying such an experience.", - "A close-up photo of an origami bird soaring through a cityscape, in a flock with others of different colors and patterns, casting intricate shadows on the buildings below.", - "Three women stand together laughing, with one woman slightly out of focus in the foreground. The sun is setting behind the women, creating a lens flare and a warm glow that highlights their hair and creates a bokeh effect in the background. The photography style is candid and captures a genuine moment of connection and happiness between friends. The warm light of golden hour lends a nostalgic and intimate feel to the image.", - "A weathered, wooden mech robot covered in flowering vines stands peacefully in a field of tall wildflowers, with a small bluebird resting on its outstretched hand. Digital cartoon, with warm colors and soft lines. A large cliff with a waterfall looms behind.", - "Photographic portrait of a real life dragon resting peacefully in a zoo, curled up next to its pet sheep. Cinematic movie still, high quality DSLR photo.", - "A view of a person’s hand holding a eucalyptus sprig - a macro DSLR image highlighting the balance of human and nature.", - "Word \"light\" made from various colorful feathers, black background", - "A single comic book panel of a boy and his father on a grassy hill, staring at the sunset. A speech bubble points from the boy's mouth and says: The sun will rise again. Muted, late 1990s coloring style", - "A photograph of a stately library entrance with the words \"Central Library\" carved into the stone", - "Photo of a felt puppet diorama scene of a tranquil nature scene of a secluded forest clearing with a large friendly, rounded robot is rendered in a risograph style. An owl sits on the robots shoulders and a fox at its feet. Soft washes of color, 5 color, and a light-filled palette create a sense of peace and serenity, inviting contemplation and the appreciation of natural beauty", - "A photo of an Indian woman hugging her friend, both covered in Holi colors and smiling, celebrating the festival with joy. Realistic photography, taken in the style of DSLR camera with 35mm lens.", - "Abstract cross-hatch sketch: a black and white sketch with loose hand in calligraphic ink showing the abstract outline in profile of a black panther poised on a branch. A canopy of trees is behind.", - "A view of a knitter’s hands executing a complex weave on a striped hat - a macro DSLR image highlighting the warmth and connection with the earth and nature.", - "A woman with blonde hair wearing sunglasses stands amidst a dazzling display of golden bokeh lights. Strands of lights and crystals partially obscure her face, and her sunglasses reflect the lights. The light is low and warm creating a festive atmosphere and the bright reflections in her glasses and the bokeh. This is a lifestyle portrait with elements of fashion photography.", - "a portrait of an auto mechanic in her workshop, holding a wrench in one hand. a old sports car in the background, with a workbench and tools all around. bokeh, high quality dslr photograph.", - "An origami owl made of brown paper is perched on a branch of an evergreen tree. The owl is facing forward with its eyes closed, giving it a peaceful appearance. The background is a blur of green foliage, creating a natural and serene setting.", - "A weathered, wooden mech robot covered in flowering vines stands peacefully in a field of tall wildflowers, with a small bluebird resting on its outstretched metallic hand. Digital cartoon, with warm colors and soft lines. A large cliff with waterfall looms behind.", - "Close-up, low angle view of a rabbit biting into a cabbage on a plate on a counter. A man wearing glasses is yelling at the rabbit and reaching out his hand to snatch the cabbage. High-contrast visuals and cinematic lighting. Fujifilm XF 10-24mm f/4, action shot.", - "Photo of vinyl toy scene. A colossal stone robot adorned with giant stone gardening tools stands in a lush, futuristic garden. A single sprout peeks out from a patch of fertile soil nearby. Digital art with a soft, dreamlike quality. Vinyl miniature scene.", - "A pair of well-worn hiking boots, caked in mud and resting on a rocky trail. There’s a squirrel’s head poking out of one of the boots. There’s a mountainous landscape in the background, captured with a Nikon D780.", - "A joyful woman with a prosthetic leg and athletic attire celebrates reaching the summit of a snowy mountain. She stands triumphantly next to her snowboard, with the vast landscape stretching out behind her. captured with a Leica M11 rangefinder camera for a timeless, film-like aesthetic.", - "Three women stand together outside with the sun setting behind them creating a lens flare. One woman in the foreground is slightly out of focus and wearing a black felt hat. The middle woman is in focus, wearing glasses, and laughing with her head tossed back. The third woman has blonde hair pulled back in a bun and is wearing a cream sweater. She is looking at the woman in glasses and smiling.", - "Two contrasting figures, one wooden and jagged, the other smooth, diamond, embrace in a sun-drenched courtyard – the Harmony of Opposites.", - "pixel art of a space shuttle blasting of, with \"STS-1\" written below it. Cape Canaveral in the background, blue skies, with plumes of smoke billowing out.", - "A yellow toy submarine diving deep under the blue ocean. Close-up nature photography, sunlight coming through the water.", - "A busy city street with people crossing the road at an intersection, illuminated by sunlight, showcasing diverse age groups and styles as they walk across zebra stripes on the pavement. The focus is sharp on one person in red , standing out against their surroundings. Shot during golden hour to capture the warm lighting effects.", - "An antique pocket watch with Roman numerals and an ornate chain, lying on a worn leather surface with a vintage map in the background, captured with a Leica Q2.", - "A cute 1970’s convertible sports car sits in front of a pub in an ink wash painting, capturing a charming English map in the background, captured with a Leica Q2.", - "Joy shines in the eyes of a young woman, a charcoal portrait showing she’s ready to make a difference in the world.", - "An elderly woman wearing a straw hat and a pink jacket is sitting next to a brown and white dog. Both the woman and the dog are looking off into the distance with serene expressions. The lighting is the warm, golden light of sunset, which creates a peaceful and contemplative atmosphere. This is a lifestyle portrait capturing a quiet moment.", - "A long exposure photo of the Milky Way in a starry night sky, centered over an ocean beach at magic hour. The milky way is bright and prominent with many stars visible against a dark and a cinematic composition in the style. blue black atmosphere in light painting photography with vivid and bold colors. Shot on a professional camera medium format camera with high contrast", - "A single comic book panel of a boy and his father on a grassy hill, staring at the sunset. A speech bubble points from the boy’s mouth says “The sun will rise again”. Muted, late 1990s coloring style.", - "Detailed illustration of majestic lion roaring proudly in a dream-like jungle, purple white line art background, clipart on light violet paper texture", - "A close-up portrait of a young woman with blonde hair and brown eyes. She is lying down and covering her mouth with a dark blue sweater, only her eyes are visible. The background is dark and blurry. The light is coming from above, creating shadows on her face.", - "A mother fox playing with her baby, showing love and affection in the natural environment of their habitat. The photo captures them sharing a moment, showcasing the bond between animals. The focus is on their faces.", - "Shot in the style of DSLR camera with the polarizing filter. A photo of three hot air balloons floating over the unique rock formations in Cappadocia, Turkey. The colors and patterns on these balloons contrast beautifully against the earthy tones of the landscape below. This shot captures the sense of adventure that comes with enjoying such an experience" - ] -} \ No newline at end of file diff --git a/archive/imagen-creative-studio/requirements.txt b/archive/imagen-creative-studio/requirements.txt deleted file mode 100644 index f4aada053..000000000 --- a/archive/imagen-creative-studio/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -mesop>=0.9.3 -Flask -gunicorn -Werkzeug -dataclasses_json -google-cloud-aiplatform -google-cloud-logging -python-dotenv diff --git a/archive/imagen-creative-studio/screenshots/creative_studio.png b/archive/imagen-creative-studio/screenshots/creative_studio.png deleted file mode 100644 index 9a6d87c02..000000000 Binary files a/archive/imagen-creative-studio/screenshots/creative_studio.png and /dev/null differ diff --git a/archive/imagen-creative-studio/screenshots/creative_studio_01.png b/archive/imagen-creative-studio/screenshots/creative_studio_01.png deleted file mode 100644 index 9b5beea66..000000000 Binary files a/archive/imagen-creative-studio/screenshots/creative_studio_01.png and /dev/null differ diff --git a/archive/imagen-creative-studio/screenshots/creative_studio_02.png b/archive/imagen-creative-studio/screenshots/creative_studio_02.png deleted file mode 100644 index be23fdea6..000000000 Binary files a/archive/imagen-creative-studio/screenshots/creative_studio_02.png and /dev/null differ diff --git a/archive/imagen-creative-studio/screenshots/model_choices.png b/archive/imagen-creative-studio/screenshots/model_choices.png deleted file mode 100644 index f4b087dd7..000000000 Binary files a/archive/imagen-creative-studio/screenshots/model_choices.png and /dev/null differ diff --git a/archive/imagen-creative-studio/screenshots/options.png b/archive/imagen-creative-studio/screenshots/options.png deleted file mode 100644 index fe582e1bb..000000000 Binary files a/archive/imagen-creative-studio/screenshots/options.png and /dev/null differ diff --git a/archive/imagen-creative-studio/screenshots/wide_anime.png b/archive/imagen-creative-studio/screenshots/wide_anime.png deleted file mode 100644 index 6f8513576..000000000 Binary files a/archive/imagen-creative-studio/screenshots/wide_anime.png and /dev/null differ diff --git a/archive/imagen-creative-studio/svg_icon/svg_icon_component.js b/archive/imagen-creative-studio/svg_icon/svg_icon_component.js deleted file mode 100644 index 733265511..000000000 --- a/archive/imagen-creative-studio/svg_icon/svg_icon_component.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright 2024 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { - LitElement, - svg, - html, - } from 'https://cdn.jsdelivr.net/gh/lit/dist@3/core/lit-core.min.js'; - -export class SVGIconComponent extends LitElement { - static properties = { - svg: { type: String } - }; - - constructor() { - super(); - } - - render() { - const span = document.createElement('span'); - span.innerHTML = this.svg; - return html`${span}`; - } - - } - -customElements.define('svg-icon', SVGIconComponent); \ No newline at end of file diff --git a/archive/imagen-creative-studio/svg_icon/svg_icon_component.py b/archive/imagen-creative-studio/svg_icon/svg_icon_component.py deleted file mode 100644 index 6385858dd..000000000 --- a/archive/imagen-creative-studio/svg_icon/svg_icon_component.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import mesop.labs as mel - -@mel.web_component(path="./svg_icon_component.js") -def svg_icon_component( - *, - svg: str | None = None, - key: str | None = None, -): - return mel.insert_web_component( - name="svg-icon", - key=key, - properties={ - "svg": svg - }, - ) \ No newline at end of file diff --git a/devserver.sh b/devserver.sh deleted file mode 100755 index 89bbddbbc..000000000 --- a/devserver.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -source .venv/bin/activate -mesop --port $PORT main.py \ No newline at end of file diff --git a/FAQ.md b/docs/FAQ.md similarity index 100% rename from FAQ.md rename to docs/FAQ.md diff --git a/developers_guide.md b/docs/developers_guide.md similarity index 100% rename from developers_guide.md rename to docs/developers_guide.md diff --git a/docs/images/home-dark.webp b/docs/images/home-dark.webp new file mode 100644 index 000000000..2ffb097e4 Binary files /dev/null and b/docs/images/home-dark.webp differ diff --git a/docs/images/home-light.webp b/docs/images/home-light.webp new file mode 100644 index 000000000..b1d203ce9 Binary files /dev/null and b/docs/images/home-light.webp differ diff --git a/docs/images/story-dark.webp b/docs/images/story-dark.webp new file mode 100644 index 000000000..62fbc2746 Binary files /dev/null and b/docs/images/story-dark.webp differ diff --git a/docs/images/story-light.webp b/docs/images/story-light.webp new file mode 100644 index 000000000..70c66ea33 Binary files /dev/null and b/docs/images/story-light.webp differ diff --git a/docs/images/video-dark.webp b/docs/images/video-dark.webp new file mode 100644 index 000000000..35cad7818 Binary files /dev/null and b/docs/images/video-dark.webp differ diff --git a/docs/images/video-light.webp b/docs/images/video-light.webp new file mode 100644 index 000000000..b61d7956e Binary files /dev/null and b/docs/images/video-light.webp differ diff --git a/tutorial.md b/docs/tutorial.md similarity index 100% rename from tutorial.md rename to docs/tutorial.md diff --git a/idx-template.json b/idx-template.json deleted file mode 100644 index c8f297130..000000000 --- a/idx-template.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "GenMedia Creative Studio: Veo", - "description": "A Veo experimental app for GenMedia Creative Studio", - "icon": "https://google.github.io/mesop/assets/logo.png", - "params": [] - } \ No newline at end of file diff --git a/idx-template.nix b/idx-template.nix deleted file mode 100644 index 46ff58d78..000000000 --- a/idx-template.nix +++ /dev/null @@ -1,17 +0,0 @@ -# No user-configurable parameters -{ pkgs, ... }: { - # Shell script that produces the final environment - bootstrap = '' - # Copy the folder containing the `idx-template` files to the final - # project folder for the new workspace. ${./.} inserts the directory - # of the checked-out Git folder containing this template. - cp -rf ${./.} "$out" - - # Set some permissions - chmod -R +w "$out" - - # Remove the template files themselves and any connection to the template's - # Git repository - rm -rf "$out/.git" "$out/idx-template".{nix,json} - ''; -} diff --git a/terraform.tfvars.example b/terraform.tfvars.example deleted file mode 100644 index faf689b09..000000000 --- a/terraform.tfvars.example +++ /dev/null @@ -1,36 +0,0 @@ -# Example Terraform variables file. -# Copy this to terraform.tfvars and fill in your actual values. -# NEVER commit terraform.tfvars to version control. - -# --- Required --- -project_id = "your-gcp-project-id" - -# --- Access / networking --- -region = "us-central1" -use_lb = true -domain = "creative-studio.example.com" -initial_user = "you@example.com" - -# Reserved (static) LB IP. Leave null to have Terraform create and manage a -# static global IP; set to an existing reserved address to reuse one. -# reserved_ip_address = "203.0.113.10" - -# --- Cloud Run tuning --- -# cloud_run_cpu = "2000m" -# cloud_run_memory = "4Gi" -# cloud_run_timeout = "1800s" -# cloud_run_max_concurrency = 4 - -# --- Storage lifecycle --- -# Delete assets older than this many days (0 disables the rule). -# asset_lifecycle_age_days = 90 - -# --- Cost-allocation labels --- -environment = "prod" -team = "creative-studio" -owner = "creative-studio" -cost_center = "creative-studio" - -# --- Safety --- -# Keep false in production to prevent accidental data loss. -enable_data_deletion = false