Giter Site home page Giter Site logo

fusionx's Introduction

GitHub contributors

Fusion Xperience ๐Ÿ”ฅ โšก

FusionX is a Flask-based web application that brings the power of neural style transfer to your fingertips. Transform ordinary images into extraordinary pieces of art by applying the styles of famous paintings.

fusionX App

โœจ Repository Vision

The goal of this repository is to provide a simple and easy-to-use web application for neural style transfer. The application is built using the Flask framework and the PyTorch library. The neural style transfer model is based on the A Neural Algorithm of Artistic Style paper by Leon A. Gatys, Alexander S. Ecker, and Matthias Bethge.

๐Ÿ“‘ Table of Contents

Features โœจ

  • Upload or Generate content images
    • Upload from your device
    • Generate using Hugging Face Text-to-Image API
  • Apply styles to content images
    • Upload from your device
    • Choose from a gallery of pre-loaded styles
    • Generate using Hugging Face Text-to-Image API
  • Customize the style transfer process with advanced options
    • Adjust the style weight
    • Adjust the content weight
    • Adjust the total variation weight
    • Adjust the number of iterations
  • Use the Editor to fine-tune the stylized image
    • Crop and Resize the image
    • Super Resolution using Real-ESRGAN
  • Download the stylized image

Application Preview ๐Ÿ“ท

The Studio page allows you to upload content and style images.

Upload Image

The Studio page also allows you to generate content and style images using the Hugging Face Text-to-Image API.

Generate Image

The Gallery page showcases a collection of pre-loaded style images that can be applied to your content images.

Gallery

Once both the content and style images are selected, you can customize the style transfer process using advanced options.

Advanced Options

The Editor page allows you to fine-tune the stylized image by cropping, resizing, and enhancing the image.

Editor

Getting Started ๐Ÿš€

Prerequisites ๐Ÿ“‹

  • Python 3.9 or higher
  • Torch

Environment Variables ๐Ÿ”‘

Create a .env file in the root directory of the project and add the following environment variables:

SECRET_KEY="your_secret_key"
HF_API_KEY="your_hugging_face_api_key"

# Hugging Face Text-to-Image API Models that fusionX uses
STABLE_DIFFUSION_V15="https://api-inference.huggingface.co/models/runwayml/stable-diffusion-v1-5"
STABLE_DIFFUSION_V21="https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-2-1"
STABLE_DIFFUSION_XL_BASE_1.0="https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0"
ANYTHING_V5="https://api-inference.huggingface.co/models/stablediffusionapi/anything-v5"
DREAMLIKE_PHOTO_REAL="https://api-inference.huggingface.co/models/dreamlike-art/dreamlike-photoreal-2.0"
DREAM_SHAPER="https://api-inference.huggingface.co/models/Lykon/DreamShaper"
NITRO_DIFFUSION="https://api-inference.huggingface.co/models/nitrosocke/Nitro-Diffusion"
DREAMLIKE_ANIME_V10="https://api-inference.huggingface.co/models/dreamlike-art/dreamlike-anime-1.0"
REALISTIC_VISION_V14="https://api-inference.huggingface.co/models/SG161222/Realistic_Vision_V1.4"

Installation ๐Ÿ’ป

# 1. Clone the repository
git clone https://github.com/yourusername/fusionX.git

# 2. Navigate to the project directory
cd fusionX

# 3. Create a virtual environment (optional)
python -m venv venv

# 4. Activate the virtual environment
source venv/bin/activate

# 5. Install the required packages
pip install -r requirements.txt

# 6. Run the application
python run.py

For Mac/Unix Users ๐Ÿš

To set up your environment and run the application on Mac or Unix systems, follow these steps:

  1. Create the Install Script: Create a file named install.sh in the root directory of the project. This script will contain all the necessary commands to install your project's dependencies.

    #!/bin/bash
    
    # Install common dependencies
    pip install -r requirements.txt
    
    # Install PyTorch with CUDA support
    pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
  2. Make the Script Executable: Run the following command in your terminal to make the script executable.

    chmod +x install.sh
  3. Execute the Install Script: Now, run the script to install your dependencies.

    ./install.sh

For Windows Users ๐ŸชŸ

Windows users should follow these steps to prepare their environment and run the application:

  1. Create the Install Script: Create a file named install.ps1 in the root directory of the project. This PowerShell script will install the necessary dependencies for the project.

    # Install common dependencies
    pip install -r .\requirements.txt
    
    # Install PyTorch with CUDA support
    pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
  2. Execute the Install Script: Open PowerShell as an administrator, navigate to the project's root directory, and run the script with the following command:

    Powershell -ExecutionPolicy Bypass -File .\install.ps1

Contributing ๐Ÿค

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. Please refer to the Contributing Guidelines for more details.

License ๐Ÿ“„

Distributed under the MIT License. See LICENSE for more information.

fusionx's People

Contributors

ali-izhar avatar dependabot[bot] avatar

Stargazers

Saeed Ahmad avatar

Watchers

 avatar

Forkers

jamespeirano

fusionx's Issues

R.TG.2

Given a text prompt, generate an image using a hugging face api. The prompt should come from the user (look at studio.html) and the "api" parameter should accept different api endpoints.

Enhance Model Crash

Enhancing an image re-initializes RealESRGAN each time you call "enhance" and crashes the system - potentially due to memory issues.

Mini photoshop R.IE.*

Start working on developing the "mini-photoshop" feature. Focus on the first component for now (R.IE.1)
Given an image, develop a feature for "resolution enhancement" that will modify the image resolution by 2x or 3x.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.