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

THIRD-PARTY VENDORS

This tutorial uses AI components to connect to OpenAI and Stability AI.

With your Instill Cloud account, you'll receive 10,000 monthly Instill Credits, which will allow you to use such components without needing to set up an account in these services.

#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 components to generate digital stickers.

#Create the pipeline

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.

A blank canvas contains two components that serve as the pipeline input and output interface:

  • Trigger is used to set the pipeline parameters when triggering a pipeline.
  • Response is used to collect the results of a trigger.

To set up the Trigger component:

  1. Locate the trigger component on the canvas.
  2. Click Add Field + and select Short Text. Fill in the Title with Prompt. The reference key for this field will be prompt. Click Save.
  3. Click Add Field + and select Short 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.

#Create the OpenAI component

  1. Click Component + and choose OpenAI from Connectors. This will add a OpenAI component openai_0 to the canvas.
  2. Select 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. You can identify the models that support default credentials from the icon next to them, displaying stack of tokens.
BRING YOUR OWN KEY

You can always use your own API Keys on the components in this tutorial by introducing them in the component's Connection configuration.

  1. In the Prompt field, specify the text prompt to generate an LLM augmented prompt:

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 ${trigger.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 ${trigger.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 ${trigger.sticker_shape} sticker with white border
Prompt: ${trigger.prompt}
Output:

PIPELINE COMPONENT REFERENCE

This prompt references the input fields in the Trigger component, providing extra context to OpenAI in order to generate a more robust and complete image prompt.

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.

  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 1 to indicate only one chat completion.

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

#Create the Stability AI component

  1. Click Component + and choose Stability AI from Connectors. This will add a Stability AI component stability_0 to the canvas.
  2. Select 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.

#Configure the Response component

The Response Component is used at the end of a VDP pipeline to return the pipeline trigger outputs.

  1. Find the response component on the 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 ${trigger.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 ${trigger.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: trigger, openai_0 and stability_0.

Click Save on the top right corner, 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 test your pipeline using real data. Let's create, for instance, 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 yellow plane soaring through a clear blue 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: 5/17/2024, 3:19:28 PM