日本熟妇hd丰满老熟妇,中文字幕一区二区三区在线不卡 ,亚洲成片在线观看,免费女同在线一区二区

使用SD生圖服務

更新時間:

前提條件

已開通智作工坊公有云服務

快速測試

操作步驟

步驟一:創建應用并查看應用詳情

  1. 控制臺進入應用管理,點擊創建應用,填寫應用信息

創建應用

  1. 選擇創建的應用,點擊查看詳情

查看應用詳情

步驟二:獲取WebUI訪問地址

點擊生成測試鏈接,選擇默認角色,點擊立即生成,瀏覽器前往 WebUI 訪問地址,開啟創作

測試鏈接測試鏈接立即生成測試鏈接生成結果

SDK調用

操作步驟

步驟一:創建應用并獲取服務AK和SK

  1. 控制臺進入應用管理,點擊創建應用,填寫應用信息

創建應用

  1. 選擇創建的應用,點擊查看詳情,查看應用AK和SK

查看應用詳情

查看應用AKSK

步驟二:接入SDK

語言

文檔

java

Java接入指南

python

Python接入指南

node.js

Node.js接入指南

步驟三:分配Token(以Java接入為例)

package com.example.demo;

import com.alibaba.cloudapi.sdk.model.ApiResponse;
import com.alibaba.cloudapi.sdk.model.HttpClientBuilderParams;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import java.util.Map;

public class Demo {
    public static void main(String[] args) throws Exception {
        String endpoint = "openai.edu-aliyun.com";

        HttpClientBuilderParams httpsParam = new HttpClientBuilderParams();
        httpsParam.setHost(endpoint);
        httpsParam.setAppKey("應用AK");
        httpsParam.setAppSecret("應用SK");
        httpsParam.setReadTimeout(300000L);
        HttpsApiClient.instance.init(httpsParam);

        // token api path
        String apiPath = "/scc/allocate_token";

        ApiResponse apiResponse = HttpsApiClient.instance.invoke(apiPath, null);
        System.out.println("Result Code:" + apiResponse.getCode());
        System.out.println("Message:" + apiResponse.getMessage());

        // get api token
        JSONObject body = JSON.parseObject(new String(apiResponse.getBody()));
        System.out.println("Token:" + ((Map<String, Object>) body.get("data")).get("apiToken"));
    }
}

步驟四:Token分配Session獲取WebUI訪問地址(以Java接入為例)

package com.example.demo;

import com.alibaba.cloudapi.sdk.model.ApiResponse;
import com.alibaba.cloudapi.sdk.model.HttpClientBuilderParams;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import java.util.HashMap;
import java.util.Map;

public class Demo {
    public static void main(String[] args) throws Exception {
        String endpoint = "openai.edu-aliyun.com";

        HttpClientBuilderParams httpsParam = new HttpClientBuilderParams();
        httpsParam.setHost(endpoint);
        httpsParam.setAppKey("應用AK");
        httpsParam.setAppSecret("應用SK");
        httpsParam.setReadTimeout(300000L);
        HttpsApiClient.instance.init(httpsParam);

        // token api path
        String apiPath = "/scc/spRefreshOrCreateSession";
        Map<String, Object> params = new HashMap<>();
        params.put("apiToken", "分配的Token");

        ApiResponse apiResponse = HttpsApiClient.instance.invoke(apiPath, params);
        System.out.println("Result Code:" + apiResponse.getCode());
        System.out.println("Message:" + apiResponse.getMessage());

        // get api token
        JSONObject body = JSON.parseObject(new String(apiResponse.getBody()));
        System.out.println("SD WebUI Url:" + ((Map<String, Object>) body.get("data")).get("sessionUrl"));
    }
}

瀏覽器前往 WebUI 訪問地址,開啟創作