vkthakur88 commited on
Commit
fa4be79
1 Parent(s): 64f9d2a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -4,13 +4,13 @@ import gradio as gr
4
 
5
  client = hf_hub.InferenceClient(token = os.environ['HF_TOKEN'])
6
 
7
- def image_interface(prompt, guidance_scale):
8
  response = client.text_to_image(
9
  prompt = f'concept art of {prompt}, oil painting, a photorealistically detailed painting, indian vedic culture, fair skinned, fantasy art, a beautiful artwork illustration, inspired by Raja Ravi Varma, trending on cg society.',
10
  negative_prompt = f'duplicate, fake, oil painting, unrealistic, dark skinned, beard, moustache, photograph, ugly, deformed, noisy, blurry, 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.',
11
  model = 'stabilityai/stable-diffusion-xl-base-1.0',
12
  guidance_scale = guidance_scale,
13
- num_inference_steps = 50
14
  )
15
 
16
  return response
@@ -19,7 +19,8 @@ app = gr.Interface(
19
  fn = image_interface,
20
  inputs = [
21
  gr.Textbox(label = 'Prompt'),
22
- gr.Slider(minimum = 1, maximum = 30, value = 7.5, step = 0.1, label = 'Guidance Scale', show_label = True)
 
23
  ],
24
  outputs = 'image',
25
  title = 'Oil Painting Generation',
 
4
 
5
  client = hf_hub.InferenceClient(token = os.environ['HF_TOKEN'])
6
 
7
+ def image_interface(prompt, guidance_scale, steps):
8
  response = client.text_to_image(
9
  prompt = f'concept art of {prompt}, oil painting, a photorealistically detailed painting, indian vedic culture, fair skinned, fantasy art, a beautiful artwork illustration, inspired by Raja Ravi Varma, trending on cg society.',
10
  negative_prompt = f'duplicate, fake, oil painting, unrealistic, dark skinned, beard, moustache, photograph, ugly, deformed, noisy, blurry, 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.',
11
  model = 'stabilityai/stable-diffusion-xl-base-1.0',
12
  guidance_scale = guidance_scale,
13
+ num_inference_steps = steps
14
  )
15
 
16
  return response
 
19
  fn = image_interface,
20
  inputs = [
21
  gr.Textbox(label = 'Prompt'),
22
+ gr.Slider(minimum = 1, maximum = 30, value = 7.5, step = 0.1, label = 'Guidance Scale', show_label = True),
23
+ gr.Slider(minimum = 0, maximum = 100, value = 50, step = 10, label = 'Number of Inference Steps', show_label = True)
24
  ],
25
  outputs = 'image',
26
  title = 'Oil Painting Generation',