ai_artist
made generating images easy using the Stable Diffusion AI model.
View a quick demo video here
- 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.
- Input the Huggingface token key to the Google Colab form, run the code to save login info by the
login()
function - Import the whole package to your project:
from ai_artist import *
- Install dependencies:
!pip install transformers
- Set up the environment:
initialize()
- Set up the pipeline:
pipe = pipegen()
- Provide your image description to the prompt:
image = image_gen("YOUR_IMAGE_DESCRIPTION", pipe)
- Save your image
image.save(f'INPUT_YOUR_IMAGE_NAME')
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.
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.
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.