Reader small image

You're reading from  Transformers for Natural Language Processing and Computer Vision - Third Edition

Product typeBook
Published inFeb 2024
Reading LevelN/a
PublisherPackt
ISBN-139781805128724
Edition3rd Edition
Languages
Tools
Right arrow
Author (1)
Denis Rothman
Denis Rothman
author image
Denis Rothman

Denis Rothman graduated from Sorbonne University and Paris-Diderot University, designing one of the very first word2matrix patented embedding and patented AI conversational agents. He began his career authoring one of the first AI cognitive Natural Language Processing (NLP) chatbots applied as an automated language teacher for Moet et Chandon and other companies. He authored an AI resource optimizer for IBM and apparel producers. He then authored an Advanced Planning and Scheduling (APS) solution used worldwide.
Read more about Denis Rothman

Right arrow

Part II: Running text-to-image with Stable Diffusion

Stability AI is a leader in Generative AI. They produced Stable Diffusion, one of the fastest-growing AI projects. This section takes you to the forefront of Stable Diffusion. To get started, you must sign up and obtain an API key: https://platform.stability.ai/docs/getting-started/python-sdk. Check the pricing policy before running the Stable Diffusion model.

Open Stable _Vision_Stability_AI.ipynb.

We first install the SDK:

!pip install stability-sdk

Then we clone the Stability modules:

!git clone --recurse-submodules https://github.com/Stability-AI/stability-sdk

We define the Stability host, which is where to connect to the Stability API server, and our key, or define it when making the request:

!export STABILITY_HOST=grpc.stability.ai:443
#!export STABILITY_KEY=[YOUR_KEY]

We can now ask Stability to generate an image based on the following prompt:

!python -m stability_sdk generate "...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Transformers for Natural Language Processing and Computer Vision - Third Edition
Published in: Feb 2024Publisher: PacktISBN-13: 9781805128724

Author (1)

author image
Denis Rothman

Denis Rothman graduated from Sorbonne University and Paris-Diderot University, designing one of the very first word2matrix patented embedding and patented AI conversational agents. He began his career authoring one of the first AI cognitive Natural Language Processing (NLP) chatbots applied as an automated language teacher for Moet et Chandon and other companies. He authored an AI resource optimizer for IBM and apparel producers. He then authored an Advanced Planning and Scheduling (APS) solution used worldwide.
Read more about Denis Rothman