Spaces:
Runtime error
Runtime error
vkthakur88
commited on
Commit
•
22d9d60
1
Parent(s):
2efb859
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import huggingface_hub as hf_hub
|
3 |
+
import gradio as gr
|
4 |
+
|
5 |
+
client = hf_hub.InferenceClient(token = os.environ['HF_TOKEN'], timeout = 300.0)
|
6 |
+
|
7 |
+
def image_interface(prompt):
|
8 |
+
response = client.text_to_image(
|
9 |
+
prompt = f'fantasy art, oil painting, in raja ravi verma style, ancient indian theme, of {prompt}.',
|
10 |
+
negative_prompt = 'naked, nsfw, duplicate, photograph, ugly, bad anatomy, bad hands, three hands, three legs, bad arms, missing legs, missing arms, poorly drawn face, bad face, fused face, cloned face, worst face, three crus, extra crus, fused crus, worst feet, three feet, fused feet, fused thigh, three thigh, fused thigh, extra thigh, worst thigh, missing fingers, extra fingers, ugly fingers, long fingers, horn, extra eyes, huge eyes, 2girl, amputation, disconnected limbs',
|
11 |
+
model = 'stabilityai/stable-diffusion-xl-base-1.0',
|
12 |
+
guidance_scale = 8,
|
13 |
+
num_inference_steps = 75
|
14 |
+
)
|
15 |
+
|
16 |
+
return response
|
17 |
+
|
18 |
+
app = gr.Interface(fn = image_interface, inputs = 'text', outputs = 'image', title = 'Oil Painting Generation')
|
19 |
+
|
20 |
+
app.launch()
|