CREATE ML_ENGINE openai_engine
FROM openai
USING
api_key = 'your-openai-api-key';
CREATE MODEL mindsdb.dalle
PREDICT img_url
USING
engine = 'openai_engine',
mode = 'image',
prompt_template = '{{text}}, 8K | highly detailed realistic 3d oil painting style cyberpunk by MAD DOG JONES combined with Van Gogh | cinematic lighting | happy colors';
{{text}}
variable present in the prompt_template
parameter is replaced with the user’s input.
SELECT text, img_url
FROM mindsdb.dalle
WHERE text = 'a cute robot helping a little kid build a better world';
+--------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| text | img_url |
+--------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| a cute robot helping a little kid build a better world | https://oaidalleapiprodscus.blob.core.windows.net/private/org-1QXk2w4H0OhDrF2Hd4QV5K2c/user-piMc91jPmVdhttPLHl2y50E7/img-p5NROyoV5ysWWUY91xhQUZdg.png?st=2023-05-29T16%3A45%3A02Z&se=2023-05-29T18%3A45%3A02Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-05-29T10%3A29%3A15Z&ske=2023-05-30T10%3A29%3A15Z&sks=b&skv=2021-08-06&sig=vUI9vedjWtA7L0J3V0/4c05Wzh1Kf2/zyl%2BN1yfK6rU%3D |
+--------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
SELECT text, img_url
FROM mindsdb.dalle
WHERE text = 'design of a happy tree house';
+------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| text | img_url |
+------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| design of a happy tree house | https://oaidalleapiprodscus.blob.core.windows.net/private/org-1QXk2w4H0OhDrF2Hd4QV5K2c/user-piMc91jPmVdhttPLHl2y50E7/img-O1GPmdmuoRXFTGdUjahOf1Ws.png?st=2023-05-29T16%3A50%3A34Z&se=2023-05-29T18%3A50%3A34Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-05-29T17%3A03%3A23Z&ske=2023-05-30T17%3A03%3A23Z&sks=b&skv=2021-08-06&sig=9vY%2Bqr/0CrzqqdM4uYEa/XwYXMBn67RBodhzsg%2Bs9ag%3D |
+------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+