File size: 1,769 Bytes
92bfa46
161d647
92bfa46
 
 
161d647
92bfa46
 
 
00714df
627fc51
92bfa46
fa4f4ad
 
92bfa46
e281065
 
161d647
 
e281065
43e7720
e281065
43e7720
e281065
43e7720
92bfa46
161d647
92bfa46
161d647
92bfa46
687a6d6
92bfa46
 
2d6b6c0
161d647
 
92bfa46
1e3b561
92bfa46
 
1e3b561
92bfa46
 
 
161d647
92bfa46
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
from asyncio import constants
import gradio as gr
import requests
import os 
import random

def desc_to_image(desc):
  
  random.seed(desc)
  #tadneSeed=random.randint(0,2**256)
  tadneSeed=random.randint(0,2**32)
  psi=0.7  

  print("seed",tadneSeed,psi)
  
  #iface = gr.Interface.load("spaces/hysts/TADNE")
  #print("about to die",iface,dir(iface))


  #img=iface.fns[0].fn(tadneSeed,psi)
  print("loading interface")
  tadne=gr.Interface.load("spaces/hysts/TADNE")
  print("calling interface")
  img=tadne(tadneSeed,psi,False)
  print("got img",img)
  return img

demo = gr.Blocks()

with demo:
  gr.Markdown("<h1><center>Safety Waifu</center></h1>")
  gr.Markdown(
        "based on <a href=https://huggingface.co/spaces/hysts/TADNE> TADNE</a>."
        '<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Idea: humans are bad and distinguishing 256 bit hex strings. Humans are good at distinguishing pictures of people. <br><br>So, let&#39;s convert Ethereum addresses to Anime characters &quot;for security&quot;.<br><br>This is Uniswap: <img width=256 src="https://pbs.twimg.com/media/EuvkFqBXAAAyQgW?format=png&name=small">pic.twitter.com/K2e3MCgXdL</a></p>&mdash; nagolinc (@nagolinc) <a href="https://twitter.com/nagolinc/status/1363434195817742337?ref_src=twsrc%5Etfw">February 21, 2021</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> '
    )

  with gr.Row():
    desc_txt = gr.Textbox(label="description",placeholder="0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984")
    output_image = gr.Image(label="portrait",type="filepath", shape=(256,256))

  b0 = gr.Button("Generate Waifu")
  
  b0.click(desc_to_image,desc_txt,output_image)
  #examples=examples

demo.launch(enable_queue=True, debug=True)