File size: 833 Bytes
c21c77f
 
9e2d762
 
 
 
5c9d8a2
9e2d762
 
 
 
 
 
 
 
5c9d8a2
eaab55c
c21c77f
7c3fa6f
eaab55c
 
a56890f
eaab55c
b3e4ce2
c21c77f
d4abf5b
c21c77f
2693b11
91ba95c
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
import gradio as gr

# import os
# import sys
# import threading
# import time

# def restart_script_periodically():
#     while True:
#         time.sleep(600) # 10 minutes
#         try:
#             os.execl(sys.executable, sys.executable, *sys.argv)
#         except:
#             pass
# threading.Thread(target=restart_script_periodically, daemon=True).start()

imagine = gr.Interface.load( "models/dreamlike-art/dreamlike-photoreal-2.0" )

with gr.Blocks( analytics_enabled=False ) as app:
    
    Prompt = gr.Textbox( label="Prompt" )
    Imagine = gr.Button( "Imagine" )
    Image = gr.Image()
    Info = gr.Markdown( "# [$hyoo_artist](https://artist.hyoo.ru/)" )

    Imagine.click( imagine, inputs=[ Prompt ], outputs=[ Image ], api_name="imagine" )

    app.launch( inline=True )
    block.queue( concurrency_count=1 )