chansung commited on
Commit
d9cf71a
·
1 Parent(s): 7fa9484

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -14,17 +14,17 @@ from share_btn import community_icon_html, loading_icon_html, share_js
14
 
15
  from huggingface_hub import from_pretrained_keras
16
 
17
- MODEL_CKPT = "chansung/textual-inversion-pipeline@v1673026791"
18
- MODEL = from_pretrained_keras(MODEL_CKPT)
19
 
20
- model = keras_cv.models.StableDiffusion(
21
- img_width=img_width, img_height=img_height, jit_compile=True
22
- )
23
- model._text_encoder = MODEL
24
- model._text_encoder.compile(jit_compile=True)
25
 
26
- # Warm-up the model.
27
- _ = model.text_to_image("Teddy bear", batch_size=num_images_to_gen)
28
 
29
  def generate_image_fn(prompt: str, unconditional_guidance_scale: int) -> list:
30
  start_time = time.time()
@@ -57,6 +57,6 @@ gr.Interface(
57
  title="Generate custom images with finetuned embeddings of Stable Diffusion",
58
  description=description,
59
  article=article,
60
- examples=[["cute Sundar Pichai creature", 8], ["Hello kitty", 8]],
61
  allow_flagging=False,
62
  ).launch(enable_queue=True)
 
14
 
15
  from huggingface_hub import from_pretrained_keras
16
 
17
+ # MODEL_CKPT = "chansung/textual-inversion-pipeline@v1673026791"
18
+ # MODEL = from_pretrained_keras(MODEL_CKPT)
19
 
20
+ # model = keras_cv.models.StableDiffusion(
21
+ # img_width=img_width, img_height=img_height, jit_compile=True
22
+ # )
23
+ # model._text_encoder = MODEL
24
+ # model._text_encoder.compile(jit_compile=True)
25
 
26
+ # # Warm-up the model.
27
+ # _ = model.text_to_image("Teddy bear", batch_size=num_images_to_gen)
28
 
29
  def generate_image_fn(prompt: str, unconditional_guidance_scale: int) -> list:
30
  start_time = time.time()
 
57
  title="Generate custom images with finetuned embeddings of Stable Diffusion",
58
  description=description,
59
  article=article,
60
+ # examples=[["cute Sundar Pichai creature", 8], ["Hello kitty", 8]],
61
  allow_flagging=False,
62
  ).launch(enable_queue=True)