PHP code example of mkhab7 / deepai

1. Go to this page and download the library: Download mkhab7/deepai library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mkhab7 / deepai example snippets


use Solid\Deepai\Deepai;

 key');

$deepai->setImage('image url'); 
// you can use a url or a local file path , for example : 

$deepai->setImage(new CURLFile('image.jpg'));


$deepai->colorize();

   
$result = $deepai->apply();

$url = $result->url();

$result->save('output.jpg');

/*
 * you can get the all response data from this method 
 */
$allResponseData = $result->getData();

$deepai->setText('cat');
$deepai->textToImage();

$deepai->setText('cat');
$textOutput = $deepai->textGeneration()->apply()->output();//returns output url/text


$deepai->setImage(new CURLFile('image.jpg'))

        ->method('deepdream') //custom method
        
        ->apply();