Morpheus
Morpheus is an open-source project that offers a creative and innovative platform for generating stunning artworks using image editing and stable diffusion models.
Install / Use
npx skills add Monadical-SAS/MorpheusInstalls into whichever agent you are using.
README
▶️ <a href="#quickstart">Quickstart</a> | <a href="https://morpheus.monadical.io/">Demo</a> | <a href="https://github.com/Monadical-SAS/Morpheus">GitHub</a> | <a href="https://github.com/Monadical-SAS/Morpheus/wiki">Documentation</a> | <a href="#background--motivation">Info & Motivation</a> | <a href="https://github.com/Monadical-SAS/Morpheus/wiki/similar-projects">Similar Projects</a> | <a href="https://github.com/Monadical-SAS/Morpheus/wiki/Roadmap">Roadmap</a>
<a href="https://github.com/Monadical-SAS/Morpheus/blob/master/LICENSE"><img src="https://img.shields.io/badge/Open_source-LGPL-green.svg?logo=git&logoColor=green"/></a> <a href="https://github.com/Monadical-SAS/Morpheus/"><img src="https://img.shields.io/github/stars/Monadical-SAS/Morpheus.svg?logo=github&label=Stars&logoColor=blue"/></a> <a href="https://github.com/Monadical-SAS/Morpheus/commits/main"><img src="https://img.shields.io/github/last-commit/Monadical-SAS/Morpheus.svg?logo=Sublime+Text&logoColor=green&label=active"/></a>
<hr/>Morpheus is an open-source project that offers a creative and innovative platform for generating stunning artworks using image editing and stable diffusion models.
<div align="center"> <sub>. . . . . . . . . . . . . . . . . . . . . . . . . . . .</sub> </div> <br/>Key Features
- Freedom & Open Source: Create your personal server and maintain complete control over your data.
- Robust & Modular Design: Our design supports and loads multiple models with ease.
- Versatility: We offer Image-to-Image support, Controlnet, and Pix2pix among other use cases.
- Local or Cloud Setup: Choose the setup that suits your needs best.
- Infrastructure as Code: We've open-sourced our infrastructure code to facilitate scalability.
<br/><br/>
<div align="center"> <br/> <img src="https://i.imgur.com/T2UAGUD.png" width="49%" alt="grass"/><img src="https://i.imgur.com/T2UAGUD.png" width="49%" alt="grass"/> </div>Quickstart
🖥 Supported OSs: Linux, macOS (M1-M2) 👾
Prequisites:
Before starting, ensure you have the following:
-
Firebase: Morpheus uses firebase to manage authentication, analytics, and the collaborative painting system. Follow the Firebase Integration Guide to enable the required firebase services.
-
Docker & Docker Compose: Both Docker and Docker-Compose should be installed on your system. If not installed yet, you can download Docker from <a href="https://docs.docker.com/get-docker/">here</a> and Docker-Compose from <a href="https://docs.docker.com/compose/install/#install-using-pip">here</a>. Skip this step if you're using a Kubernetes setup.
-
Hardware: The hardware requirements for this setup will vary depending on the specific application that you are developing. However, it is generally recommended to have a machine with at least 16 GB of RAM and a GPU with 16 GB of VRAM. If you don't have a GPU, you can use a cloud provider like AWS, GCP, or Azure. Skip this step if you're using a Kubernetes setup. <br/>
Setup Steps
Step 1: Verify that Docker is installed and running
Ensure that Docker and Docker-Compose are installed on your system. If not, install them using the links above. For Linux users, you might also need to add your user to the docker group. For more information, see the <a href="https://docs.docker.com/engine/install/linux-postinstall/">Docker documentation</a> for more details.
Step 2: Clone the repository
Clone the repository to your local system using the command below:
git clone git@github.com:Monadical-SAS/Morpheus.git
Step 3: Navigate to the Morpheus directory
Change your current directory to the cloned repository:
cd Morpheus
Step 4: Create a secrets file
Create the secrets file by copying the distributed .env files:
cp -p morpheus-server/secrets.env.dist morpheus-server/secrets.env
cp -p morpheus-client/env.local.dist morpheus-client/.env.local
cp -p morpheus-client/env.local.dist morpheus-admin/.env.local
Step 5: Edit the morpheus-server/secrets.env file with your values
This step involves editing the secrets.env file to provide the application with the necessary secrets to connect to
the database, Firebase, AWS, and other services.
Parameters:
POSTGRES_USER: The username for the PostgreSQL database.POSTGRES_DB: The name of the PostgreSQL database.POSTGRES_PASSWORD: The password for the PostgreSQL database.POSTGRES_HOST: The hostname or IP address of the PostgreSQL database server.POSTGRES_PORT: The port number of the PostgreSQL database server.PGADMIN_DEFAULT_EMAIL: The email address for the PGAdmin default user.PGADMIN_DEFAULT_PASSWORD: The password for the PGAdmin default user.FIREBASE_PROJECT_ID: The ID of your Firebase project.FIREBASE_PRIVATE_KEY: The private key for your Firebase project.FIREBASE_CLIENT_EMAIL: The client email for your Firebase project.FIREBASE_WEB_API_KEY: The web API key for your Firebase project.AWS_ACCESS_KEY_ID: The access key ID for your AWS account.AWS_SECRET_ACCESS_KEY: The secret access key for your AWS account.IMAGES_BUCKET: The name of the S3 bucket where images are stored.MODELS_BUCKET: The name of the S3 bucket where models are stored.IMAGES_TEMP_BUCKET: The name of the S3 bucket where temporary images are stored.ENVIRONMENT: The environment where the application is running. This can belocal,staging, orproduction.
Instructions:
- Open the
secrets.envfile in your preferred text editor. - Replace all content with the following:
POSTGRES_USER=morpheus
POSTGRES_DB=morpheus
POSTGRES_PASSWORD=password
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
# PGAdmin credentials
PGADMIN_DEFAULT_EMAIL=admin@admin.com
PGADMIN_DEFAULT_PASSWORD=admin
FIREBASE_PROJECT_ID="XXXXXXX="
FIREBASE_PRIVATE_KEY="XXXXXXX="
FIREBASE_CLIENT_EMAIL="XXXXXXX="
FIREBASE_WEB_API_KEY="XXXXXXX="
# AWS credentials
AWS_ACCESS_KEY_ID=XXXXXXX=
AWS_SECRET_ACCESS_KEY=XXXXXXX=
# S3 BUCKETS ID
#------------------------
# Bucket name where images are stored
IMAGES_BUCKET="XXXXXXX="
# Bucket name where models are stored
MODELS_BUCKET="XXXXXXX="
# Bucket/Folder where temporal images are stored
IMAGES_TEMP_BUCKET="ßXXXXXXX="
# App config
ENVIRONMENT="local"
- Update the values with your own.
- Save the file.
Once you have updated the secrets.env file, the application will be able to connect to the database, Firebase, AWS,
and other services using the secrets that you provided.
Step 6. Edit the morpheus-client/.env.local and morpheus-admin/.env.local files with your values
This step involves editing the .env.local files in the morpheus-client and morpheus-admin directories to provide
the client application with the necessary values to connect to the backend API, Firebase, and other services.
Parameters:
NEXT_PUBLIC_API_URL: The URL of the backend API.NEXT_PUBLIC_FIREBASE_CONFIG: The Firebase configuration for your Firebase project. This can be found in the Firebase console.NEXT_TELEMETRY_DISABLED: A boolean value indicating whether to disable telemetry.NEXT_PUBLIC_BACKEND_V2_GET_URL: The URL of the Excalidraw backend v2 GET endpoint.NEXT_PUBLIC_BACKEND_V2_POST_URL: The URL of the Excalidraw backend v2 POST endpoint.NEXT_PUBLIC_LIBRARY_URL: The URL of the Excalidraw libraries page.NEXT_PUBLIC_LIBRARY_BACKEND: The URL of the Excalidraw library backend.NEXT_PUBLIC_WS_SERVER_URL: The URL of the WebSocket server.NEXT_PUBLIC_GOOGLE_ANALYTICS_ID: The Google Analytics ID for the client application.FAST_REFRESH: A boolean value indicating whether to enable Fast Refresh.
Instructions:
- Open the
.env.localfile in your preferred text editor. - Replace all content with the following:
# API CONFIG
NEXT_PUBLIC_API_URL=http://localhost:8001
# Firebase configuration
NEXT_PUBLIC_FIREBASE_CONFIG='{"apiKey":"XXXXXXXXXXXX","authDomain":"xxxxxxxxxx.firebaseapp.com","projectId":"xxxxxxx","storageBucket":"xxxxxx.appspot.com","messagingSenderId":"123456789","appId":"1:123456789:web:xxxxxx","measurementId":"G-XXXXXXXXXX"}'
# NEXT CONFIG
NEXT_TELEMETRY_DISABLED=1
# EXCALIDRAW CONFIG
NEXT_PUBLIC_BACKEND_V2_GET_URL=https://json-dev.excalidraw.com/api/v2/
NEXT_PUBLIC_BACKEND_V2_POST_URL=https://json-dev.excalidraw.com/api/v2/post/
NEXT_PUBLIC_LIBRARY_URL=https://libraries.excalidraw.com
NEXT_PUBLIC_LIBRARY_BACKEND=https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries
NEXT_PUBLIC_WS_SERVER_URL=ws://localhost:3002
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=G-XXXXXXXXXX
FAST_REFRESH=false
- Update the values with your own.
- Save the file.
Once you have updated the .env.local file, the client application will be able to connect to the backend API,
Firebase, and other services using the values that you provided.
Step 7. Init the database
To initialize the database, apply the migrations by executing the following commands:
docker compose run --rm datalib alembic upgrade head
Step 8. Run the Morpheus project
To run the Morpheus project, execute the following command:
docker compose up
The Morpheus project will be running on your local machine at localhost:3000 (client), localhost:3001 (admin), and localhost:8001 (api). Morpheus uses some Stable Diffusion models by default, if you want to change the setup you can do it from the administration panel.
Development
Running the backend tests
- To run all the tests:
docker compose run --rm api pytest. - To run a specific test:
docker compose run --rm api pytest tests/«test_module».py. - To run a specific test function:
docker compose run --rm api pytest tests/«test_module».py::«test_function».
Related Skills
node-connect
385.5kDiagnose OpenClaw Android, iOS, or macOS node pairing, QR/setup code, route, auth, and connection failures.
ankra-cli
40.5kAnkra CLI rules and best practices for managing Kubernetes clusters via the Ankra platform
blender-python-addon
40.5kBlender Python add-on rules for operators, panels, properties, registration, testing, and API-safe scripting
flutter-development-guidelines-cursorrules-prompt-file
40.5kCursor rules for Flutter development with MVVM architecture, Riverpod state management, Material widgets, and Dart style guidelines.
