File size: 1,466 Bytes
44f12da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a3b6a3b
44f12da
 
 
 
 
 
 
 
 
 
 
a3b6a3b
44f12da
 
 
 
 
a3b6a3b
44f12da
 
 
a3b6a3b
 
44f12da
 
 
 
 
a3b6a3b
44f12da
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1">
    <title></title>
    <script src="./jquery">

    </script>
    <script>
        function txt2images() {
            var size = $("#size").val();
            body = {
                "prompt": $("#input").val(),
                "size": size
            }
            var qq = "";
            $.ajax({
                url: './txt2pic',
                data: body,
                type: 'post',
                async: false,
                success: function (data, textStatus, jqXHR) {
                    $("#show").attr("src", data);
                }
            })
        }
    </script>
</head>

<body>
<table>
    <tr>
        <td>输入提示词:</td>
        <td colspan="2"><textarea rows="2" cols="30" id="input">汽车</textarea></td>
    </tr>
    <tr>
        <td>选择尺寸:</td>
        <td><select id="size">
            <option>2560x1440</option>
            <option>1920x1080</option>
            <option>1024x1024</option>
            <option>512x512</option>
            <option selected>256x256</option>
        </select>提交之后等待几秒出图
        </td>
        <td>
            <button value="提交" onclick="txt2images()">提交</button>
        </td>
    </tr>
    <tr>
        <td colspan="4"><img id="show" height="512" width="512"/></td>

    </tr>
</table>
</body>

</html>