php调用Stable-Diffusion官方api实现图片放大变清晰示例代码

代码语言:php

所属分类:其他

代码描述:php调用Stable-Diffusion官方api实现图片放大变清晰示例代码

代码标签: php 调用 Stable Diffusion 官方 api 图片 放大 清晰 示例 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<?php
//申请地址:https://platform.stability.ai/account/keys
$_apikey = "";
// Initialize a cURL session
$ch = curl_init();

// Set up the file to be sent via POST
$imageFilePath = '/data/wwwroot/default/asset/man.png';

$imageFile = new CURLFile($imageFilePath);


// Set the cURL options for the request
curl_setopt($ch, CURLOPT_URL, "https://api.stability.ai/v2beta/stable-image/upscale/creative");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CU.........完整代码请登录后点击上方下载按钮下载查看

网友评论0