| | <!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> |