Jungduri commited on
Commit
97757ff
1 Parent(s): 2a56e59

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. README.md +2 -0
  2. app.py +5 -4
README.md CHANGED
@@ -1,6 +1,8 @@
1
  ---
2
  title: DMGA
3
  app_file: app.py
 
 
4
  ---
5
  # Doodle sketch board + image generation
6
  - [x] How to use gradio
 
1
  ---
2
  title: DMGA
3
  app_file: app.py
4
+ sdk: gradio
5
+ sdk_version: 3.34.0
6
  ---
7
  # Doodle sketch board + image generation
8
  - [x] How to use gradio
app.py CHANGED
@@ -34,8 +34,8 @@ pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
34
  # this command loads the individual model components on GPU on-demand.
35
  pipe.enable_model_cpu_offload()
36
 
37
- prompt = "closeup face photo of caucasian lady in black clothes, night city street, bokeh"
38
- negative_prompt = "(deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime:1.4), text, close up, cropped, out of frame, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck"
39
 
40
  n_steps = 25
41
 
@@ -45,7 +45,8 @@ generator = torch.manual_seed(0)
45
  # prompt=prompt, num_inference_steps=20, generator=generator, image=canny_image
46
  # ).images[0]
47
 
48
- def predict(prompt):
 
49
  image = pipe(
50
  prompt=prompt,
51
  negative_prompt=negative_prompt,
@@ -65,7 +66,7 @@ def predict(prompt):
65
  return image
66
 
67
 
68
- demo = gr.Interface(fn=predict, inputs="text", outputs="text")
69
 
70
  if __name__ == "__main__":
71
  demo.launch()
 
34
  # this command loads the individual model components on GPU on-demand.
35
  pipe.enable_model_cpu_offload()
36
 
37
+ # prompt = "closeup face photo of caucasian lady in black clothes, night city street, bokeh"
38
+ # negative_prompt = "(deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime:1.4), text, close up, cropped, out of frame, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck"
39
 
40
  n_steps = 25
41
 
 
45
  # prompt=prompt, num_inference_steps=20, generator=generator, image=canny_image
46
  # ).images[0]
47
 
48
+ def predict(prompt,negative_prompt):
49
+ # prompt, negative_prompt = inputs
50
  image = pipe(
51
  prompt=prompt,
52
  negative_prompt=negative_prompt,
 
66
  return image
67
 
68
 
69
+ demo = gr.Interface(fn=predict, inputs=[gr.Textbox(value="prompt"), gr.Textbox(value="negative prompt")], outputs="image")
70
 
71
  if __name__ == "__main__":
72
  demo.launch()