Code Monkey home page Code Monkey logo

mystablediffusion's Introduction

myStableDiffusion

License: MIT
Introducing a hands-on image generation by stable diffusion model!!!
Feel free to modify and try various prompts to guide your image generation, powered by openai's pretrained CLIP model clip-vit-large-patch14.
Compared with traditional diffusion model where noising and denoising is applied to all pixels, this very version applies only to latent space, hence much more efficient with arguably minor performance degradation. It takes astounishing 1 min to generate a 512x512 image with 50 iterations by CUDA on my RTX3060Ti.
Noteworthilly, runing on CPU or MacOS is supported but not encouraged. It takes roughly 5 hours on my 2021 Macbook pro to generate 512x512 image with 25 iterations... the heat is also unacceptable :(

Reference

https://lilianweng.github.io/posts/2021-07-11-diffusion-models/#quick-summary
https://huggingface.co/docs/diffusers/main/en/using-diffusers/write_own_pipeline
https://nn.labml.ai/diffusion/stable_diffusion/model/unet.html

Demo

Prompt:"Chinese grandparents with their grandson, in cartoon style"
Iterations: 50
2

Prompt:""Beautiful girl with long hair and glasses"
Iterations: 75
6

Note

For user in China Mainland, the direct access to huggingface.co may be blocked no matter whether VPN applied.
A remedy towards this is to download the model to your local path, and change the arg named pretrained_model_name_or_path of function from_pretrained() to the very absolute path.

mystablediffusion's People

Contributors

pengkun-zhu avatar

Stargazers

 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.