Site icon Efficient Coder

Ghibli At Home: Transform Photos into Studio Ghibli Magic on Your Linux Machine

Unleash Your Inner Artist: A Comprehensive Guide to Ghibli At Home

In the realm of digital art, transforming ordinary photos into stunning works of art has always been a sought – after skill. Today, I’m excited to introduce you to Ghibli At Home, a remarkable AI – powered photo stylizer that lets you create magic right on your local machine.

What Is Ghibli At Home?

Ghibli At Home is a cutting – edge AI – based local photo stylization tool driven by the sophisticated FLUX.1 – Kontext – dev and DFloat11 model pipeline. With this tool, you can effortlessly convert your images into Ghibli – inspired, anime – like, artistic, or even custom styles, all within the comfort of your own computer.

The software boasts a modern web UI with numerous style profiles, undo/redo capabilities, and advanced controls. It’s designed to run on consumer – grade GPUs like the RTX 3090/4090 and above. Thanks to the DFloat11 quantization algorithm, it reduces VRAM requirements by approximately 30% without compromising on quality. All images and processing jobs are stored locally and automatically cleaned up, ensuring your privacy and freeing up space. Plus, it handles logging and queuing in – memory, eliminating the need for external dependencies like Redis or Celery.

Currently, Ghibli At Home is exclusively available for Linux, but Windows support is on the horizon.

System Requirements and Installation Process

System Requirements

  • Operating System : Linux only.
  • Python Version : 3.11 or higher.
  • GPU : NVIDIA GPU with approximately 21GB of VRAM (based on the current DFloat11 quantization implementation).
  • Browser : A modern web browser such as Chrome, Firefox, or Edge.

Installation Steps

  1. Clone the Project : Open your terminal and run “git clone <https://github.com/TheAhmadOsman/4o – ghibli – at – home.git>” to clone the project to your local machine. Then navigate to the project directory using “cd 4o – ghibli – at – home”.

  2. Create and Activate a Python Virtual Environment : It’s highly recommended to use uv for managing your virtual environment. If you don’t have uv installed, you can get it by running “curl – LsSf https://astral.sh/uv/install.sh | sh”. Once installed, create a virtual environment with “uv venv .venv –python 3.12” and activate it using “source .venv/bin/activate”.

  3. Install Dependencies : With your virtual environment activated, execute “uv sync” to install the Python dependencies specified in the pyproject.toml file.

  4. Configure Your Environment : Copy the “.env_template” file in the project root directory and rename it to “.env”. Open the new “.env” file and customize the settings according to your preferences. If you haven’t logged in using “huggingface – cli login”, you’ll need to set “HUGGING_FACE_HUB_TOKEN” in the “.env” file with a token generated from your Hugging Face account settings to download gated models from Hugging Face.

Key Features of Ghibli At Home

Diverse Style Conversion Options

Ghibli At Home goes beyond just Ghibli – style conversions. It offers dozens of built – in style profiles across categories like Animation, Artistic, and Vintage. Whether you want to turn your photos into oil paintings, comic – book art, cyberpunk cityscapes, or vintage film stills, this tool has you covered. You can even save your own custom styles and tweak the defaults. Best of all, no login is required, and your images remain securely stored on your local device.

Efficient Model Pipeline

Powered by black – forest – labs/FLUX.1 – Kontext – dev and enhanced with DFloat11, Ghibli At Home ensures high – quality image generation on consumer – grade hardware. The DFloat11 quantization algorithm significantly reduces VRAM requirements, making it possible to run the full, lossless model on high – end consumer GPUs like the RTX 3090 and 4090.

User – Friendly Frontend Interface

  • Style Profile Management : Save, load, and delete your favorite settings with ease for quick access to your preferred styles.
  • Undo/Redo Functionality : Minimize creative risks with the ability to undo and redo actions during the editing process.
  • Advanced Control Options : Fine – tune parameters such as prompts, inference steps, guidance scales, and seeds to achieve the exact artistic effect you desire.

Environment Configuration and Storage Management

Simply use the “.env” file to manage settings like queue size, file storage locations, and device selection. The software also includes an automatic cleanup feature to remove old job data and files, helping you maintain a clutter – free workspace.

Simplified Architecture and Intelligent Logging

With no external dependencies like Redis or Celery, the software’s architecture is straightforward yet powerful. It utilizes Loguru for clean, readable logs and automatically filters out noisy status checks to keep your console tidy and focused.

Asynchronous Task Queue

The built – in, thread – safe in – memory queue processes image generation tasks one at a time, preventing server overload and ensuring smooth operation.

Running and Using Ghibli At Home

Running the Software

  • Development Environment : Start the server in development mode by running “python3.12 app.py” in your terminal.
  • Production Environment : For production use, leverage a production – grade WSGI server like Gunicorn. First, install the production dependencies with “uv sync –group prod”. Then, launch the server using “gunicorn –workers 1 –threads 4 –timeout 600 – b 0.0.0.0:5000 app:app”. Remember, it’s crucial to use only one worker process due to the in – memory queue design.

Customizing the Port

You can specify a different port for the server by using the “–port” option when starting the app. For example, “python3.12 app.py –port 5555” will run the server on port 5555. If no port is specified, the server defaults to port 5000.

Accessing and Using the Application

Once the server is up and running, open your web browser and go to “http://127.0.0.1:5000“. Here, you’ll find an intuitive interface where you can upload images and begin the stylization process.

API Endpoints

  • “POST/process – image” : Submit an image processing task and receive a “job_id” in response.
  • “GET/status/<job_id>” : Check the status of a specific task. Possible statuses include “queued”, “processing”, “completed”, and “failed”. If the task is queued, the response will also include “queue_position”.
  • “GET/result/<job_id>” : Once a task is “completed”, use this endpoint to retrieve the generated PNG image.

Project Structure Overview

  • “app.py” : This file contains the all – in – one Flask server, API endpoints, and background image processing workers.
  • “pyproject.toml” : Holds project metadata and dependency information.
  • “static/*” : Houses the complete dynamic frontend application.
  • “generated_images/” : The default directory where generated images are stored.
  • “.env” : Created from “.env_template”, this file stores all local configuration settings.

Production Deployment Checklist

  • Create and configure the “.env” file on your production server.
  • If your frontend is hosted separately, update “CORS(app)” in “app.py” to specify your frontend domain.
  • Critical! Run the application with a single worker process, such as “gunicorn –workers 1”.
  • Place a reverse proxy like Nginx or Apache in front of the application to handle SSL/TLS, caching, and rate limiting.
  • Set up log rotation for your WSGI server’s output.
  • Implement monitoring to track server health and resource usage (CPU, GPU, RAM).
  • Optionally, add an authentication layer for private deployments.

Frequently Asked Questions (FAQ)

Q1: What operating systems does Ghibli At Home support?

At present, Ghibli At Home is only compatible with Linux. However, Windows support is in development. This means that if you’re using Windows or macOS, you won’t be able to install and run the software just yet. But don’t worry; the development team has Windows support on their roadmap, and installation and setup guides should be available soon.

Q2: What GPU specifications are required to run Ghibli At Home?

According to the official requirements, Ghibli At Home requires an NVIDIA GPU with approximately 21GB of VRAM (based on the current DFloat11 quantization implementation). Therefore, high – end consumer – grade GPUs like the RTX 3090, 4090, and above are recommended. However, the development team is actively exploring support for additional quantization options and CPU offloading. This means that in the future, the software may have lower GPU VRAM requirements, making it accessible to a broader range of users.

Q3: How can I quickly get started with Ghibli At Home?

First, ensure your Linux system meets the software’s requirements, including installing Python 3.11 or higher and NVIDIA GPU drivers. Then, follow the installation steps outlined earlier: clone the project, create and activate a virtual environment, install dependencies, and configure the environment. If you encounter any issues during operation, check the software’s log files or search for similar problems on GitHub. Familiarize yourself with the software’s frontend interface and features, and experiment with different style profiles and parameter settings to accelerate your learning process.

Q4: Does Ghibli At Home support batch image processing?

Currently, Ghibli At Home primarily operates through its web interface, allowing users to upload and process images one by one. However, the software provides API endpoints like “POST/process – image”, which can theoretically be utilized for batch image processing via scripts. If you have programming knowledge, you can write scripts in Python or other languages to call these APIs and achieve batch processing of images. Of course, this requires an understanding of API usage and script writing, and you should manage request frequency to avoid overloading the server.

Q5: What is the quality of the generated images?

Ghibli At Home employs advanced AI models and quantization algorithms to produce high – quality stylized images on high – end consumer – grade GPUs. Thanks to DFloat11 quantization technology, it reduces VRAM consumption while minimizing the impact on image quality. The actual output quality depends on factors such as the input image’s quality, the selected style profile, and parameter settings. Generally speaking, the clearer and more detailed the input image, the higher the quality of the generated stylized image. Additionally, adjusting the software’s advanced control options, such as prompts and inference steps, can help improve the quality of the generated images.

Q6: Does the software support custom models or styles?

Ghibli At Home offers a variety of preset style profiles for users to choose from and allows users to save and apply custom styles by adjusting style parameters. However, regarding the import and use of fully custom models, the software is currently based on the black – forest – labs/FLUX.1 – Kontext – dev model and DFloat11 technology. It has not explicitly stated whether it supports the import of user – defined models. If you have specific model requirements, you can keep an eye on the software’s updates or submit feature requests on GitHub.

Q7: How can I ensure stable operation of Ghibli At Home in a production environment?

To run Ghibli At Home stably in a production environment, first ensure that you’ve completed all configurations according to the deployment checklist, including properly setting up the “.env” file, running the server with a single worker process, and adding a reverse proxy. Additionally, regularly monitor the server’s resource usage, such as CPU, GPU, and memory, as well as disk space. Adjust server configurations or clean up unnecessary files promptly to maintain system stability. Set up a log rotation mechanism to prevent log files from becoming too large. If possible, consider adding load balancing and failover mechanisms to further enhance service availability and reliability.

Q8: How can I contribute to the development of Ghibli At Home or suggest new features?

Ghibli At Home’s source code is hosted on GitHub. You can visit its project repository page to view the development progress, submit bug reports, or suggest new features. If you have programming skills, you can fork the project code and submit code changes or new features following the project’s contribution guidelines. The development team typically reviews community contributions regularly and integrates valuable improvements into the main version. Contributing to open – source projects not only helps you enhance your programming skills but also benefits other users by providing a better experience.

Conclusion

Ghibli At Home is a powerful local AI – based photo stylization tool. With its rich array of style options, efficient model pipeline, and user – friendly interface, it offers digital art creators a new platform for artistic expression. Although there are some limitations in terms of operating system support and hardware requirements, the development team is actively working to address these issues. For users who prioritize privacy protection and high – quality image generation, Ghibli At Home is definitely worth trying. I hope this guide helps you better understand and get started with this software, allowing you to embark on your AI – powered photo art creation journey. If you encounter any problems during use, feel free to seek help on GitHub or exchange experiences with other users.

Exit mobile version