ChatGPT’s mainstream introduction in 2022 kicked off an era of Generative AI that has brought both awe and apprehension. Its ability to generate human-like text, images and music has undoubtedly reshaped industries and opened new possibilities. However, with these advancements comes the pressing concerns of untraceability, where the origins of AI-generated content and training data remains obscured, raising ethical and accountability issues.
Though much of the mainstream discussion surrounding Generative AI has been focused on limiting its sentience, a more pressing undiscussed issue is the blurring boundaries between human and AI creations and the need for more traceability and transparency. One year later, the situation on the surface surrounding Generative AI remains largely the same. We don’t know if what we are viewing is human or AI generated.
In the midst of this technological excitement, Numbers Protocol has been working behind the scenes to serve the provenance needs of anything digital so when Generative AI came into the picture, we were more than ready to accommodate. Today we are going to showcase how Numbers Protocol works in tandem with AI platforms to create traceable Generative AI content.
Prerequisites
We will not be writing any code in this showcase as we will be using Instill AI’s Versatile Data Pipeline (VDP) to construct our traceable Generative AI. Instill AI provides no/low code tools to convert unstructured data into meaningful data representations. If you're interested make sure to check them out here.
You will need to create an Instill AI account in order to create the data pipeline and a Capture Account to create on-chain records. Since we are interacting with the Numbers blockchain to create on-chain records we will need NUM token to facilitate these transactions. New Capture accounts are credited with 12 NUM Credits which equates to 120 registrations at no cost.
Here's our tutorial video, if you prefer to watch a video.
Create a Capture Account
Navigate here, click on “Create an account” and fill in username, email and password to create an account. Alternatively you can utilize the Numbers API to create an account.
Create a Free Instill AI Account
Navigate to instill.tech. Click on “Try Instill Cloud Free” and follow the prompts to create a free Instill Account.
Add New Pipeline
From the Instill Dashboard navigate to Pipeline & Click on “Add new pipeline”
Set up Pipeline Properties
Instill AI will automatically assign a random ID. Rename to something more descriptive
Renamed ID to “stablediffusion-numbersprotocol”. Adding a description is optional.
Set up Source & Destination
Click on Source and under Popular Presets drag the Trigger component to the center pipeline editor area. If your box is grayed out you may need to click “Connect” on the right hand trigger menu.
Click on Destinations and under Popular Presets drag the Response component to the center pipeline editor area. If your box is grayed out you may need to click “Connect” on the right hand trigger menu.
Adding AI & Blockchain Components
From the components bar click on AI and search for Stability AI text to image and drag it onto the pipeline editor
From the components bar click on Blockchain and drag onto the pipeline editor instill-numbers component
Set up the connections
Configure your pipeline like shown above. Text-toImage takes in text input which is fed into Stability AI to output an Image. This Image is stored along with metadata inputs onto the Numbers blockchain. Since we are interested in also recording our prompt we can also feed the text input Numbers. As a final output we are interested in seeing our final image and the metadata stored on-chain
Activate
Click “Activate” in bottom right to save and initialize our pipeline. Open up the pipeline properties window to view details on how to trigger the pipeline
This pipeline creates an API endpoint that we can initialize by sending a POST request. Before we do that we will need to set up a free API token by navigating to Settings > API Token
Setting our API Call in Postman
In Postman we can set our API as POST and paste in the endpoint. Under Header we can add Authorization with Bearer <Install AI Token>
Our Body we can set to “raw” and structure our inputs as a JSON with “text’ and “metadata” as inputs.
Filling out our Inputs
Fill in texts with a prompt of your choosing. For this example we used “Shiba Inu Pokemon Trainer”
In order for on-chain records to be created on Numbers Blockchain you will need NUM token to facilitate the transactions. Follow instructions here to acquire Capture Token, you will need this in the next step.
Fill in metadata with the expected parameters. These can be found here in the Instill AI Documentation under “Expected input data fields”. Set your account by inserting your Capture token under the “capture_token” parameter.
SETUP DONE! Let’s send the request!
After roughly a minute we have our output. We have our Image in base64 encoded format and if we scroll to the bottom we can view the metadata summary. We see here the AI Generated image was registered to Numbers Blockchain and given an asset_cid. The asset_cid is a unique used to search up assets on Numbers Blockchain. We also have an asset_url which we can click to view its asset profile.
Viewing the Asset Profile
You can think of the asset-profile as the LinkedIn profile of AI Generated image. It's here where you can see the full information summary of the image including creator, license, generatedBy. All of this information is gathered from on-chain records which we can access from the bottom commit table. Feel free to check out this image asset profile for yourself!
Reviewing On-Chain Records
From the commit table click on the transaction opens up the transaction record on Numbers Blockchain. We can click on UTF-8 under Call Function to display the metadata that was recorded on-chain.
For a better view of the metadata we can click on the Asset Tree link from the asset profile commit table. The Asset Tree is a formatted file standard containing the assets information. It contains information like license, creator, encoding format, etc.
That’s It!
In this walkthrough we were able to set up a fully operating data pipeline that takes a text prompt and generates an image utilizing Stable Diffusion AI model. Unlike other AI generated images, it was also registered with a unique ID onto the Numbers Blockchain creating an on-chain record defining the images license, creator, and most importantly how it was created. In other words, we have created a fully transparent and traceable WEB3.0 AI Generated asset that is able to standout in a sea of untraceability.
Next Steps
If you are interested in learning more about Numbers Protocol check out our documentation. Also consider joining our Telegram and Discord Community to get the latest news on Numbers Protocol. If you're a developer and have questions, we would love to hear from you! We have more developer related content coming soon. So stay tuned!