Syzygianinfern0 / Pika-Art-API

🎨 An unofficial API for Pika.art
0 stars 0 forks source link

Question about upload image #1

Open gray311 opened 1 week ago

gray311 commented 1 week ago

Hi!Thanks for your great work.

I would like to know if there is a way to upload both prompt text and start frame simultaneously.

For example

data = (
            "------WebKitFormBoundarylhk4yuvhmhQhMsem\r\n"
            'Content-Disposition: form-data; name="pikaffect"\r\n\r\n\r\n'
            "------WebKitFormBoundarylhk4yuvhmhQhMsem\r\n"
            f'Content-Disposition: form-data; name="promptText"\r\n\r\n{prompt}\r\n'
            "------WebKitFormBoundarylhk4yuvhmhQhMsem\r\n"
            'Content-Disposition: form-data; name="model"\r\n\r\n1.5\r\n'
            "------WebKitFormBoundarylhk4yuvhmhQhMsem\r\n"
            f'Content-Disposition: form-data; name="image"\r\n\r\n{image_url}\r\n'
            "------WebKitFormBoundarylhk4yuvhmhQhMsem\r\n"
            'Content-Disposition: form-data; name="options"\r\n\r\n'
            '{"aspectRatio":1.7777777777777777,"frameRate":24,"camera":{},"parameters":{"guidanceScale":12,"motion":1,"negativePrompt":""},"extend":false}\r\n'
            "------WebKitFormBoundarylhk4yuvhmhQhMsem\r\n"
            f'Content-Disposition: form-data; name="userId"\r\n\r\n{user_id}\r\n'
            "------WebKitFormBoundarylhk4yuvhmhQhMsem--\r\n"
        )

However, in this case the external image_url is not valid, it must be a link that has been uploaded to the PIKA web to be valid https://cdn.pika.art/v1/files/ e404f0b1b83416991a7bd19c4c5720480a63a19ca1557c5a3a4a3abf0f48c349/image_0.jpg

Can you help me with this problem?

Syzygianinfern0 commented 1 week ago

Can you just try giving the local path to the image when you do this?