Quickstart Guide

#Authorisation

#Instill Cloud

To get started with Instill Cloud, you'll need to create an account if you haven't already. If you already have an account, simply log in to begin your journey with Instill Cloud. Experience the power of Instill Cloud by clicking the link below:

When signing up, you have three options:

  • Sign in with your Google account
  • Sign in with your GitHub account
  • Use your email address and password
TIP

If you choose to sign up with your email address and password, we will send you a verification email. Please check your inbox, and if you don't find the email, make sure to check your spam folder. If it's in the spam folder, mark it as "Not Spam".

#Self-hosted Instill Core

To get started with Instill Core, you'll need to follow the deployment guide to launch Instill Core on your local machine. After the deployment, you can access the Console at http://localhost:3000. If you're configuring Instill Core for the first time, please use the following initial login details to initiate the password reset process for onboarding:

  • Username: admin
  • Password: password

This protects Instill Core from being accessible by anyone when deployed.

Provide the initial username `admin` and password `password` to reset the password for onboarding
Provide the initial username `admin` and password `password` to reset the password for onboarding

Instill Core or Instill Cloud empowers you to build pipelines tailored for processing unstructured data using Versatile Data Pipeline (VDP). The central concept in VDP is the Pipeline, which automates a sequence of components to process unstructured data.

#Build Your First AI Workflow

PREREQUISITES

To get started with this tutorial, you'll need both an OpenAI account and a Stability AI account. Here's how to set them up:

  • Create an OpenAI account by visiting openai.com. Access to your API keys can then be managed through OpenAI's Account page.
  • Create a Stability AI account by visiting dreamstudio.ai. Access to your API keys can then be managed through DreamStudio's Account page. All new users are granted 25 free credits upon creating an account.

#Build the Pipeline

In this guide, we'll walk you through creating your first AI pipeline, specifically focusing on a generative pipeline using the OpenAI and Stability AI Connectors to generate digital stickers.

Step 1: Create Connector

Begin by navigating to the Connectors page on the navbar. Since you haven't set up any pipelines yet, this page will be empty.

To set up an OpenAI connector resource, follow these steps:

  1. Click on + Create Connector, add select OpenAI on the Modal.
  2. Provide a unique ID for the resource. Here we use openai. Optionally, you can add a description.
  3. Fill in the API Key. Follow the OpenAI documentation to find your API key.
  4. Optionally, specify which organization is used for the request.
  5. Click Save.

Next, set up a Stability AI connector resource:

  1. Click on + Create Connector, add select Stability AI on the Modal.
  2. Assign a unique ID for the resource. Here we use stability-ai, and you can optionally add a description.
  3. Provide the API Key. Follow the Stability AI documentation to find your API key.
  4. Click Save.

Step 2: Build the Pipeline in the No-code Pipeline Builder

Now, head to the Pipelines page on the navbar. To create your first pipeline through the Console:

  1. Click on + Create Pipeline.
  2. Assign a unique ID for the pipeline. Here we use digital-sticker-maker, and you can optionally add a description. By default, the owner of the pipeline is your account. But you can also assign it to an organization that you are a member of.
  3. Choose the visibility of the pipeline. By default, the pipeline is private, but you can also make it public, so that it can be seen by anyone.
  4. Click Create.

This will redirect you to the no-code pipeline builder. On the canvas, you can drag and drop connectors and operators to construct your pipeline.

By default, the Start Component and End Component are already added to the canvas. The Start Component serves as the starting point of a VDP pipeline, where you can define the input data for your application.

To set up a Start component:

  1. Locate the start component on canvas
  2. Click Add Field + and select Text. Fill in the Title with Prompt. The reference key for this field will be prompt. Click Save.
  3. Click Add Field + and select Text, Fill in the Title with Sticker Shape. Similarly, the reference key for this field will be sticker_shape. Click Save.

This configuration requires two inputs: a prompt to generate the idea for the sticker and a shape parameter to control the sticker's appearance.

To configure an OpenAI connector:

  1. Click + Add Component and choose openai from the Existing Connectors. This will add a OpenAI connector openai_0 to the canvas.
  2. Select TASK_TEXT_GENERATION from the dropdown of the OpenAI Component field.
  3. Choose Model to choose the model to use, e.g., gpt-3.5-turbo.
  4. In the Prompt field, specify the text prompt to generate an LLM augmented prompt:
PIPELINE COMPONENT REFERENCE

When establishing connections between components, referencing a component field is as simple as using ${}. When you enter ${ into an input field, the smart hint feature intelligently filters and presents only the relevant hints that are compatible with the field.


Augment the prompt with descriptive details for generating sticker images, and add the styles exactly at the end of the prompt "sticker style, flat icon, vector, die-cut ${start.sticker_shape} sticker with white border".
Only return the output content.
Prompt: a bear
Output: a brown bear dancing in a forest, sticker style, flat icon, vector, die-cut ${start.sticker_shape} sticker with white border
Prompt: a dog writes code
Output: a dog writes code in front of a laptop and drinks coffee, sticker style, flat icon, vector, die-cut ${start.sticker_shape} sticker with white border
Prompt: ${start.prompt}
Output:

  1. Click the More link on the openai_0 connector to open configuration right panel.
  2. Fill System Message to set the behavior of the model. Here we set the value to:

You are a prompt engineer to generate Stable Diffusion prompts to generate sticker images.

  1. Fill Temperature with a number between 0 and 2 to control how random the generation is, e.g., 1.
  2. Set n to in the 1 to indicate only one chat completion.

The OpenAI connector will automatically link to the Start component since we have used ${start.sticker_shape} and ${start.prompt} in the OpenAI connector configuration. The ${} placeholders represent string values to be filled during pipeline triggering.

To set up an Stability AI connector:

  1. Click + Add Component and choose stability-ai from existing resource. This will add a OpenAI connector stability_0 to the canvas.
  2. Select TASK_TEXT_TO_IMAGE from the dropdown of the Stability AI Component field.
  3. Choose the Engine to use, e.g., stable-diffusion-xl-1024-v1-0.
  4. In the Prompts field, specify the generated text array from the OpenAI connector output ${openai_0.output.texts}.
  5. Click the More link on the stability_0 component to open configuration right panel.
  6. Update the width to 1024 and the height to 1024 to set the resolution of the generated image.
  7. Adjust CFG Scale to control how strictly the diffusion process adheres to the text prompt, e.g., set it to 8.
  8. Set Samples to 1 to indicate generating only one image.
  9. Specify a Seed with 0 for a randomization.
  10. Fill Steps to 30 to indicate the number of diffusion steps to run.

You will see that the Stability AI connector is automatically linked to the OpenAI connector since we have used ${openai_0.output.texts} in the Stability AI connector configuration.

The End Component is used at the end of a VDP pipeline to receive the output as a response when triggering the pipeline.

To set up an End component:

  1. Find the end component on canvas.
  2. Click Add Field + and fill in the Title with My Original Prompt, the reference key for this field will be my_original_prompt, and Value with ${start.prompt}. Click Save.
  3. Click Add Field + and fill in the Title with Sticker Shape, the reference key for this field will be sticker_shape, and Value with ${start.sticker_shape}. Click Save.
  4. Click Add Field + and fill in the Title with LLM Powered Prompt, the reference key for this field will be llm_powered_prompt, and Value with ${openai_0.output.texts}. Click Save.
  5. Click Add Field + and fill in the Title with Digital Sticker, the reference key for this field will be digital_sticker, and Value with ${stability_0.output.images}. Click Save.

You will see that the End component is automatically linked to multiple components: start, openai_0 and stability_0.

Click Save on the top right corner, and your pipeline is ready to be tested.

#Test the Pipeline via No-Code

🎉 Congratulations! Your first VDP pipeline is all set up and ready to go.

You can now put your pipeline to the test using real data. For instance, let's create a sticker featuring a yellow plane in the sky.


Prompt: yellow plane on the sky
Shape: round

Now, simply click on the Run button located in the top right corner.

Test the pipeline with real data
Test the pipeline with real data

Click the Output tab of the openai_0 component to view the generated output. As you can see, the OpenAI ChatGPT model has expanded our initial prompt, turning it into:


a bright yellow vintage plane flying through a fluffy white cloud-filled sky, sticker style, flat icon, vector, die-cut round sticker with white border

Give it a try!

#Use the Pipeline via Low-Code

In order to trigger the pipeline, you need a valid API token. If you don't have one yet, follow these steps:

  1. Click on the profile icon on the top right corner of the main page in the console and select Settings.
  2. Navigate to the API Tokens page.
  3. Click Create Token and give it an ID.

The API tokens do not expire, so keep them safe. If a token is compromised, select it and click Delete. Be cautious, as this operation cannot be undone, and apps using the token will stop working.

VDP automatically generates a dedicated trigger endpoint for each pipeline to process data. To trigger the pipeline, follow these steps:

  1. Click the *Toolkit button on the top right corner of the pipeline canvas.
  2. Copy the cURL request in the Trigger Snippet section and pass your API token as a Bearer token in the Authorization header
  3. Adjust and ingest your data accordingly in the example request

Here is an example trigger request for the pipeline:


curl -X POST 'https://api.instill.tech/vdp/v1beta/users/<user-id>/pipelines/<pipeline-id>/trigger' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <api_token>' \
--data '{
"inputs": [
{
"prompt": "yellow plane on the sky",
"sticker_shape": "round"
}
]
}'

Where <user-id> represents your username, and <pipeline-id> corresponds to the pipeline ID.

You should receive the following response:


{
"outputs": [
{
"digital_sticker": [
"iVBORw0KGgo...SUVORK5CYII="
],
"llm_powered_prompt": [
"a bright yellow vintage plane flying through a fluffy white cloud-filled sky, sticker style, flat icon, vector, die-cut round sticker with white border"
],
"prompt": "yellow plane on the sky",
"sticker_shape": "round"
}
],
"metadata": {
"traces": {...}
}
}

To obtain the generated image, decode the "digital_sticker" field of the response from Base64 format.

Decoded digital sticker image
Decoded digital sticker image

#Generate Stickers in Batch

Interested in generating multiple stickers at once? You can do this by adjusting the Stability AI connector configuration and setting Samples to 4.

Save your changes and test the pipeline again with the following prompt:


Prompt: cat reads a book
Shape: round

Generate four stickers in a batch
Generate four stickers in a batch

#Clone Pipelines from Instill Hub

No need to start from scratch! Take advantage of the Instill Hub, a platform designed for exploring and sharing a wide range of pipelines within the community. Simply select the one that suits your needs and clone it to your Instill Cloud account.

#Use Models on Instill Cloud

Deploying and maintaining ML models in a production environment can be challenging. To simplify this process, we have deployed a list of pre-trained ML models on Instill Cloud. These models are ready for use and are entirely free during Open Alpha.

To explore the available pre-deployed ML models for different AI tasks, navigate to the Models on the Instill Cloud console. Each model in the Model Hub is designed to handle a specific AI task.

For detailed information about a specific model, click on its ID and review the Description and Setting sections. If you want to import the model into VDP, refer to the VDP documentation on the Instill Model AI connector.

Last updated: 3/21/2024, 1:42:31 PM