dbaranchuk commited on
Commit
265d8de
·
1 Parent(s): 2c9d51e

Update space

Browse files
Files changed (1) hide show
  1. app.py +3 -20
app.py CHANGED
@@ -15,6 +15,7 @@ pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
15
  # Adapt the InstructPix2Pix model using the LoRA parameters
16
  adapter_id = "latent-consistency/lcm-lora-sdv1-5"
17
  pipe.load_lora_weights(adapter_id)
 
18
 
19
  MAX_SEED = np.iinfo(np.int32).max
20
  MAX_IMAGE_SIZE = 1024
@@ -48,30 +49,12 @@ with gr.Blocks(css=css) as demo:
48
  with gr.Column(elem_id="col-container"):
49
  gr.Markdown(
50
  f"""
51
- # ⚡ Invertible Consistency Distillation
52
- # ⚡ Text-guided image editing with 8-step iCD-SD1.5 ⚡
53
- This is a demo for [Invertible Consistency Distillation](https://yandex-research.github.io/invertible-cd/),
54
- a diffusion distillation method proposed in [Invertible Consistency Distillation for Text-Guided Image Editing in Around 7 Steps](https://arxiv.org/abs/2406.14539)
55
- by [Yandex Research](https://github.com/yandex-research).
56
  Currently running on {power_device}
57
  """
58
  )
59
  gr.Markdown(
60
- "**Please** check the examples to catch the intuition behind the hyperparameters, which are quite important for successful editing. A short description: <br />1. *Dynamic guidance tau*. Controls the interval where guidance is applied: if t < tau, then guidance is turned on for t < tau."
61
- " Lower tau values provide better reference preservation. We commonly use tau=0.6 and tau=0.8. <br />"
62
- "2. *Cross replace steps (crs)* and *self replace steps (srs)*. Controls the time step interval "
63
- "where the cross- and self-attention maps are replaced. Higher values lead to better preservation of the reference image. "
64
- "The optimal values depend on the particular image. "
65
- "Mostly, we use crs and srs from 0.2 to 0.6. <br />"
66
- "3. *Amplify word* and *Amplify factor*. Define the word that needs to be enhanced in the edited image. <br />"
67
- "4. *Blended word*. Specifies the object used for making local edits. That is, edit only selected objects. <br />"
68
- "5. *Is replacement*. You can set True, if you replace only one word in the original prompt. But False also works in these cases."
69
- )
70
- gr.Markdown(
71
- "Feel free to check out our [image generation demo](https://huggingface.co/spaces/dbaranchuk/iCD-image-generation) as well."
72
- )
73
- gr.Markdown(
74
- "If you enjoy the space, feel free to give a ⭐ to the <a href='https://github.com/yandex-research/invertible-cd' target='_blank'>Github Repo</a>. [![GitHub Stars](https://img.shields.io/github/stars/yandex-research/invertible-cd?style=social)](https://github.com/yandex-research/invertible-cd)"
75
  )
76
  with gr.Row():
77
 
 
15
  # Adapt the InstructPix2Pix model using the LoRA parameters
16
  adapter_id = "latent-consistency/lcm-lora-sdv1-5"
17
  pipe.load_lora_weights(adapter_id)
18
+ pipe.to('cuda')
19
 
20
  MAX_SEED = np.iinfo(np.int32).max
21
  MAX_IMAGE_SIZE = 1024
 
49
  with gr.Column(elem_id="col-container"):
50
  gr.Markdown(
51
  f"""
52
+ # ⚡ Instruct-p2p with Consistency Distillation⚡
 
 
 
 
53
  Currently running on {power_device}
54
  """
55
  )
56
  gr.Markdown(
57
+ "If you enjoy the space, feel free to give a to the <a href='https://github.com/yandex-research/invertible-cd' target='_blank'>Github Repo</a>. [![GitHub Stars](https://img.shields.io/github/stars/quickjkee/instruct-pix2pix-distill?style=social)](https://github.com/quickjkee/instruct-pix2pix-distill)"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  )
59
  with gr.Row():
60