Giter VIP home page Giter VIP logo

midjourneyremix's Introduction

MidjourneyRemix

This is a repo containing small image mixup demo.
Based on: https://huggingface.co/lambdalabs/sd-image-variations-diffusers.
Main instruments: hugging face diffusers with pytorch

1 2 2
1 2 2

Installation

git clone https://github.com/naburov/MidjourneyRemix
cd MidjourneyRemix
<create venv if you want>
pip install -r requirements.txt

Usage

To run:

python main.py </path/to/first/image> </path/to/second/image> --second_image_weight <weight> --backend <backend>
python main.py ./examples/1/landscape.jpeg ./examples/1/style.jpeg --second_image_weight 0.9

This should create result.jpg in the root of the repo folder.
Caution: default device (--backend argument) is mps, change it if you need to cuda:0 or cpu

How does it work

This is a latent diffusion pipeline. Generation of image is conditioned on embeddings from CLIP. lambdalabs/sd-image-variations-diffusers implements conditioning on image embeddings instead of text embeddings (as in CompVis/stable-diffusion-v1-5).
Image mixing is done via weightening embeddings of base images.

embedding_for_generation = w * embedding_from_the_first_image + (1 - w) * embedding_from_the_second_image

It is possible due to the latent space properties like in word2vec.

midjourneyremix's People

Contributors

naburov avatar

Watchers

 avatar

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.