Skip to content

thinh-vu/ai_artist

Repository files navigation

I. INTRODUCTION

ai_artist made generating images easy using the Stable Diffusion AI model.

Version Download Badge Commit Badge License Badge

II. HOW TO USE THIS PROJECT

View a quick demo video here

2.1. Install this package

  • Using pip to install the pre-built package on Pypip pip install ai_artist
  • If you want to use the latest ai_artist version instead of the stable one, you can install it from the source with the following command: pip install git+https://github.com/thinh-vu/ai_artist.git@main

(*) You might need to insert a ! before your command when running terminal commands on Google Colab.

2.2. Set up your project

  1. Input the Huggingface token key to the Google Colab form, run the code to save login info by the login() function
  2. Import the whole package to your project: from ai_artist import *
  3. Install dependencies: !pip install transformers
  4. Set up the environment: initialize()
  5. Set up the pipeline: pipe = pipegen()

2.3. Start generating images

  1. Provide your image description to the prompt: image = image_gen("YOUR_IMAGE_DESCRIPTION", pipe)
  2. Save your image image.save(f'INPUT_YOUR_IMAGE_NAME')

III. RERERENCES

3.1. Get the HuggingFace API key

Generate a token key with a read permission. Read the doc here

About Huggingface

Huggingface is a community and data science platform that provides:

  • Tools that enable users to build, train and deploy ML models based on open source (OS) code and technologies.
  • A place where a broad community of data scientists, researchers, and ML engineers can come together and share ideas, get support and contribute to open source projects.

3.2. Google Colab and GPU runtime are highly recommended

Go to the Google Colab menu: Select Runtime > Change runtime type and make sure that GPU has been chosen. You can run this AI model way faster with GPU on Google Colab than the normal CPU or your personal computer.

gpu_setting

Stable Diffusion & StabilityAI

  • Stable Diffusion on Github: here

  • Stable Diffusion prompt guide and examples here

IV. 🙋‍♂️ CONTACT INFORMATION


If you want to support my open-source projects, you can "buy me a coffee" via Patreon or Momo e-wallet (VN). Your support will help to maintain my blog hosting fee & to develop high-quality content.

Momo QR

momo-qr