File size: 834 Bytes
92bfa46
161d647
92bfa46
 
 
161d647
92bfa46
 
 
 
 
 
 
 
161d647
 
92bfa46
 
161d647
92bfa46
161d647
92bfa46
 
 
 
161d647
 
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
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)
  psi=0.7  
  
  iface = gr.Interface.load("spaces/hysts/TADNE")
  print("about to die",iface,dir(iface))


  img=iface(tadneSeed,psi)
  return img

demo = gr.Blocks()

with demo:
  gr.Markdown("<h1><center>NPC Generator</center></h1>")
  gr.Markdown(
        "based on <a href=https://huggingface.co/spaces/hysts/TADNE> TADNE</a>."
    )

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

  b0 = gr.Button("Randomize name,race and class")
  
  b0.click(desc_to_image,desc_txt,output_image)
  #examples=examples

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