cocktailpeanut commited on
Commit
d1c2665
·
1 Parent(s): b355b1a
Files changed (1) hide show
  1. app.py +15 -13
app.py CHANGED
@@ -14,8 +14,10 @@ elif torch.cuda.is_available():
14
  else:
15
  DEVICE = "cpu"
16
 
17
- edit_file = hf_hub_download(repo_id="stabilityai/cosxl", filename="cosxl_edit.safetensors")
18
- normal_file = hf_hub_download(repo_id="stabilityai/cosxl", filename="cosxl.safetensors")
 
 
19
 
20
  def set_timesteps_patched(self, num_inference_steps: int, device = None):
21
  self.num_inference_steps = num_inference_steps
@@ -64,16 +66,6 @@ with gr.Blocks(css=css) as demo:
64
  gr.Markdown('''# CosXL demo
65
  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)
66
  ''')
67
- with gr.Tab("CosXL"):
68
- with gr.Group():
69
- with gr.Row():
70
- prompt_normal = gr.Textbox(show_label=False, scale=4, placeholder="Your prompt, e.g.: backlit photography of a dog")
71
- button_normal = gr.Button("Generate", min_width=120)
72
- output_normal = gr.Image(label="Your result image", interactive=False)
73
- with gr.Accordion("Advanced Settings", open=False):
74
- negative_prompt_normal = gr.Textbox(label="Negative Prompt")
75
- guidance_scale_normal = gr.Number(label="Guidance Scale", value=7)
76
- gr.Examples(examples=normal_examples, fn=run_normal, inputs=[prompt_normal], outputs=[output_normal], cache_examples=True)
77
  with gr.Tab("CosXL Edit"):
78
  with gr.Group():
79
  image_edit = gr.Image(label="Image you would like to edit", type="pil")
@@ -84,7 +76,17 @@ with gr.Blocks(css=css) as demo:
84
  with gr.Accordion("Advanced Settings", open=False):
85
  negative_prompt_edit = gr.Textbox(label="Negative Prompt")
86
  guidance_scale_edit = gr.Number(label="Guidance Scale", value=7)
87
- gr.Examples(examples=edit_examples, fn=run_edit, inputs=[image_edit, prompt_edit], outputs=[output_edit], cache_examples=True)
 
 
 
 
 
 
 
 
 
 
88
  button_edit.click(
89
 
90
  )
 
14
  else:
15
  DEVICE = "cpu"
16
 
17
+ #edit_file = hf_hub_download(repo_id="stabilityai/cosxl", filename="cosxl_edit.safetensors")
18
+ #normal_file = hf_hub_download(repo_id="stabilityai/cosxl", filename="cosxl.safetensors")
19
+ edit_file = hf_hub_download(repo_id="cocktailpeanut/c", filename="cosxl_edit.safetensors")
20
+ normal_file = hf_hub_download(repo_id="cocktailpeanut/c", filename="cosxl.safetensors")
21
 
22
  def set_timesteps_patched(self, num_inference_steps: int, device = None):
23
  self.num_inference_steps = num_inference_steps
 
66
  gr.Markdown('''# CosXL demo
67
  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)
68
  ''')
 
 
 
 
 
 
 
 
 
 
69
  with gr.Tab("CosXL Edit"):
70
  with gr.Group():
71
  image_edit = gr.Image(label="Image you would like to edit", type="pil")
 
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
+ gr.Examples(examples=edit_examples, fn=run_edit, inputs=[image_edit, prompt_edit], outputs=[output_edit], cache_examples=False)
80
+ with gr.Tab("CosXL"):
81
+ with gr.Group():
82
+ with gr.Row():
83
+ prompt_normal = gr.Textbox(show_label=False, scale=4, placeholder="Your prompt, e.g.: backlit photography of a dog")
84
+ button_normal = gr.Button("Generate", min_width=120)
85
+ output_normal = gr.Image(label="Your result image", interactive=False)
86
+ with gr.Accordion("Advanced Settings", open=False):
87
+ negative_prompt_normal = gr.Textbox(label="Negative Prompt")
88
+ guidance_scale_normal = gr.Number(label="Guidance Scale", value=7)
89
+ gr.Examples(examples=normal_examples, fn=run_normal, inputs=[prompt_normal], outputs=[output_normal], cache_examples=False)
90
  button_edit.click(
91
 
92
  )