devingulliver commited on
Commit
70f7306
·
1 Parent(s): e0e8021

Switch engine over to DPO finetune

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -11,7 +11,8 @@ import gradio as gr
11
 
12
  # load SDXL pipeline
13
  vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
14
- pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", vae=vae, torch_dtype=torch.float16)
 
15
  pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
16
  pipe = pipe.to("cuda")
17
 
@@ -144,7 +145,7 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="green",secondary_hue="green", f
144
  det_in = gr.Image(interactive=True, sources=["upload","clipboard"], show_label=False)
145
  det_btn.click(fn=manager, inputs=det_in, outputs=det_out)
146
  with gr.Row():
147
- gr.HTML('<center><h1>&nbsp;</h1>Acknowledgements: Dendrokronos uses <a href="https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0">SDXL 1.0</a> for the underlying image generation and <a href="https://arxiv.org/abs/2305.20030">research by Yuxin Wen</a> for the watermark technology. Dendrokronos is a project by Devin Gulliver.</center>')
148
 
149
  app.queue()
150
  app.launch(show_api=False)
 
11
 
12
  # load SDXL pipeline
13
  vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
14
+ unet = UNet2DConditionModel.from_pretrained("mhdang/dpo-sdxl-text2image-v1", subfolder="unet", torch_dtype=torch.float16)
15
+ pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", unet=unet, vae=vae, torch_dtype=torch.float16)
16
  pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
17
  pipe = pipe.to("cuda")
18
 
 
145
  det_in = gr.Image(interactive=True, sources=["upload","clipboard"], show_label=False)
146
  det_btn.click(fn=manager, inputs=det_in, outputs=det_out)
147
  with gr.Row():
148
+ gr.HTML('<center><h1>&nbsp;</h1>Acknowledgements: Dendrokronos uses <a href="https://huggingface.co/mhdang/dpo-sdxl-text2image-v1">SDXL DPO 1.0</a> for the underlying image generation and <a href="https://arxiv.org/abs/2305.20030">an algorithm by UMD researchers</a> for the watermark technology.<br />Dendrokronos is a project by Devin Gulliver.</center>')
149
 
150
  app.queue()
151
  app.launch(show_api=False)