File size: 1,129 Bytes
22d9d60
 
 
 
e05c2cb
22d9d60
 
 
b28094f
08d7807
 
08da1d3
0e24e63
22d9d60
 
08d7807
22d9d60
5302e8f
 
 
 
 
 
 
22d9d60
 
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
import os 
import huggingface_hub as hf_hub
import gradio as gr

client = hf_hub.InferenceClient(token = os.environ['HF_TOKEN'])

def image_interface(prompt):
    response = client.text_to_image(
        prompt = f'fantasy art, oil painting, in raja ravi verma style, ancient indian theme, painting of {prompt}.',
        negative_prompt = 'duplicate, photograph, ugly, old, 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',
        model = 'stabilityai/stable-diffusion-xl-base-1.0',
        guidance_scale = 7,
        num_inference_steps = 50
    )

    return response

app = gr.Interface(
    fn = image_interface, 
    inputs = 'text', 
    outputs = 'image', 
    title = 'Oil Painting Generation',
    description = 'Vinay Kumar Thakur'
)

app.launch()