Hello,
I’m working on a personal project from months and just recently i found a way to pass DallE generated images to my imgur account.
That used to produce the public URL to be futher used in combination with other API and GPT actions schemas.
After the most recent updates this is not working anymore.
From my test it looks like the OpenAi schema action in combination with ImgurAPI is not working as well > always producing errors.
The only solution i found was to force my custom GPT to execute a python script that upload the DallE generated image to imgur under my account.
The script was working extra good, but now something broke it.
This is the script i’ve been using:
from PIL import Image
import requests
# Your OAuth2 Access Token
access_token = 'ACCESS_TOKEN'
#SKIP STEP 1 IF SOURCE IMAGE FILE IS .PNG AND UPLOAD .PNG AS IT IS.
# Step 1: Load the generated image and convert it to JPEG format
image_path = '/mnt/data/A_serene_landscape_with_mountains,_a_lake_reflecti.png'
converted_image_path = '/mnt/data/converted_image.jpg'
# Convert image to JPEG
with Image.open(image_path) as img:
rgb_img = img.convert('RGB')
rgb_img.save(converted_image_path, 'JPEG')
# Step 2: Upload the converted image to Imgur
headers = {
'Authorization': f'Bearer {access_token}'
}
data = {
'title': 'DallE Upload'
}
with open(converted_image_path, 'rb') as img:
files = {'image': img}
response = requests.post('https://api.imgur.com/3/image', headers=headers, files=files, data=data)
# Step 3: Check if the upload is successful
if response.status_code == 200:
link = response.json()['data']['link']
print(f"Public Link (uploaded to your account): {link}")
else:
print(f"Upload failed: {response.status_code} - {response.text}")
- Now my goal is to generate image with DallE, and create a smooth workflow where i can control which image i want to upload and then perfom extra actions with the public url of the image.
Like generate 3D models or AI video or whatever.
I created a custom GPT to handle all of this and was working great until yesterday.
It is crucial to obtain a public url for the dallE image in order to have the workflow fast and efficent.
-
I dont want to use the openAPI to create the images as i want to be able to test multiple images and chose the one i want to proceed with in a smooth conversational workflow > not having the api blindly generating images that i will discard 80%
-
Having DallE image public url allows for combinations with OpenApi schemas within the chat. Thats what i want
-
If i have to manually download the image, manually upload to imgur, manually copy the link back to the chat to run the auomation, well… this is not super smart for what i want to build.
In conclusion: Is there a way to address this or something i’m missing?