multimodalart HF staff commited on
Commit
3566189
1 Parent(s): 6e59fbf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -41,7 +41,7 @@ def run_normal(prompt, negative_prompt="", guidance_scale=7, progress=gr.Progres
41
  return pipe_normal(prompt, negative_prompt=negative_prompt, guidance_scale=guidance_scale, num_inference_steps=20).images[0]
42
 
43
  @spaces.GPU
44
- def run_edit(image, prompt, negative_prompt, guidance_scale, progress=gr.Progress(track_tqdm=True)):
45
  resolution = 1024
46
  image.resize((resolution, resolution))
47
  return pipe_edit(prompt=prompt,image=image,height=resolution,width=resolution,negative_prompt=negative_prompt, guidance_scale=guidance_scale,num_inference_steps=20).images[0]
@@ -51,7 +51,8 @@ max-width: 768px !important;
51
  margin: 0 auto;
52
  }
53
  '''
54
- normal_examples = ["portrait photo of a girl, photograph, highly detailed face, depth of field, moody light, golden hour, style by Dan Winters, Russell James, Steve McCurry, centered, extremely detailed, Nikon D850, award winning photography", "backlit photography of a dog", "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k"]
 
55
  with gr.Blocks(css=css) as demo:
56
  gr.Markdown('''# CosXL demo
57
  Unofficial demo for CosXL, a SDXL model tuned to produce full color range images. CosXL Edit allows you to perform edits on images. Both have a [non-commercial community license](https://huggingface.co/stabilityai/cosxl/blob/main/LICENSE)
@@ -76,7 +77,7 @@ with gr.Blocks(css=css) as demo:
76
  with gr.Accordion("Advanced Settings", open=False):
77
  negative_prompt_edit = gr.Textbox(label="Negative Prompt")
78
  guidance_scale_edit = gr.Number(label="Guidance Scale", value=7)
79
-
80
  button_edit.click(
81
 
82
  )
 
41
  return pipe_normal(prompt, negative_prompt=negative_prompt, guidance_scale=guidance_scale, num_inference_steps=20).images[0]
42
 
43
  @spaces.GPU
44
+ def run_edit(image, prompt, negative_prompt="", guidance_scale=7, progress=gr.Progress(track_tqdm=True)):
45
  resolution = 1024
46
  image.resize((resolution, resolution))
47
  return pipe_edit(prompt=prompt,image=image,height=resolution,width=resolution,negative_prompt=negative_prompt, guidance_scale=guidance_scale,num_inference_steps=20).images[0]
 
51
  margin: 0 auto;
52
  }
53
  '''
54
+ normal_examples = ["portrait photo of a girl, photograph, highly detailed face, depth of field, moody light, golden hour, style by Dan Winters, Russell James, Steve McCurry, centered, extremely detailed, Nikon D850, award winning photography", "backlit photography of a dog", "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k", "A photo of beautiful mountain with realistic sunset and blue lake, highly detailed, masterpiece"]
55
+ edit_examples = [["mountain.png", "make it a cloudy day"], ["painting.png", "make the earring fancier"]]
56
  with gr.Blocks(css=css) as demo:
57
  gr.Markdown('''# CosXL demo
58
  Unofficial demo for CosXL, a SDXL model tuned to produce full color range images. CosXL Edit allows you to perform edits on images. Both have a [non-commercial community license](https://huggingface.co/stabilityai/cosxl/blob/main/LICENSE)
 
77
  with gr.Accordion("Advanced Settings", open=False):
78
  negative_prompt_edit = gr.Textbox(label="Negative Prompt")
79
  guidance_scale_edit = gr.Number(label="Guidance Scale", value=7)
80
+ gr.Examples(examples=edit_examples, fn=run_edit, inputs=[image_edit, prompt_edit], outputs=[output_edit], cache_examples=True)
81
  button_edit.click(
82
 
83
  )