CoolFace
Apppublic

TSE1966/Super-Resolution-Anime-Diffusion

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
api.py36 linesDownload Raw Back to root
1# -*- coding: utf-8 -*-2# file: api.py.py3# time: 20:37 2022/12/64# author: yangheng <hy345@exeter.ac.uk>5# github: https://github.com/yangheng956# huggingface: https://huggingface.co/yangheng7# google scholar: https://scholar.google.com/citations?user=NPq5a_0AAAAJ&hl=en8# Copyright (C) 2021. All Rights Reserved.9import requests10from PIL import Image11from io import BytesIO12 13response = requests.post(14    "https://yangheng-super-resolution-anime-diffusion.hf.space/run/generate",15    json={16        "data": [17            "anything v3",18            "girl,lovely,cute,beautiful eyes,cumulonimbus clouds,sky,detailed fingers,pants,red hair,blue eyes,flower meadow,Elif",19            7.5,20            15,21            512,22            512,23            0,24            "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",25            0.5,26            "",27            2,28        ]29    },30    timeout=3000,31)32 33img = Image.open(BytesIO(response.content))34img.show()35img.save("test_api.png")36