AP123 multimodalart HF Staff commited on
Commit
3704c95
·
1 Parent(s): f439b68

fixes and niceties (#2)

Browse files

- Delete diffusers-0.39.0.dev0-py3-none-any.whl (46784b6adb18facfb0a671488eb876ba492cdc7c)
- Update app.py (5eb26d082d38a600e76c8d3f611915f60bdb60a6)
- Update requirements.txt (992463ea752570e91e4b913bc136d8e2796160d1)
- Delete __pycache__ (3a14252c80716ff74b9a7adb1dd0d79d91c46b68)
- Update app.py (3f0002c8dd4e48124628c034edce5d12bc5b2ba1)
- Update app.py (d5ffdb92d021b0ce58952dd9c05817f693ba95f5)


Co-authored-by: Apolinário from multimodal AI art <multimodalart@users.noreply.huggingface.co>

__pycache__/app.cpython-312.pyc DELETED
Binary file (5.85 kB)
 
app.py CHANGED
@@ -3,14 +3,6 @@ import os
3
  import random
4
  import subprocess
5
  import sys
6
-
7
- # The Krea2 pipeline ships as a private diffusers build bundled with this Space.
8
- # Install it from the local wheel at runtime (the repo files are present here,
9
- # unlike during the build-time pip step).
10
- _wheel = glob.glob(os.path.join(os.path.dirname(__file__), "diffusers-*.whl"))
11
- if _wheel:
12
- subprocess.check_call([sys.executable, "-m", "pip", "install", "--no-cache-dir", _wheel[0]])
13
-
14
  import spaces
15
  import torch
16
  import gradio as gr
@@ -198,14 +190,14 @@ def _duration(prompt, negative_prompt, model, steps, guidance, width, height, se
198
  @spaces.GPU(duration=_duration, size="xlarge")
199
  def generate(
200
  prompt,
201
- negative_prompt,
202
- model,
203
- steps,
204
- guidance,
205
- width,
206
- height,
207
- seed,
208
- randomize,
209
  progress=gr.Progress(track_tqdm=True),
210
  ):
211
  if not prompt or not prompt.strip():
@@ -370,7 +362,7 @@ footer { display: none !important; }
370
  .gradio-container .prose a { color: """ + KREA_ACCENT + """; }
371
  """
372
 
373
- with gr.Blocks(title="Krea 2", fill_height=True) as demo:
374
  with gr.Column(elem_id="page"):
375
  gr.HTML(
376
  """
@@ -451,8 +443,12 @@ with gr.Blocks(title="Krea 2", fill_height=True) as demo:
451
  else:
452
  # No bundled sample images present; show the prompts as text.
453
  gr.Examples(
 
454
  examples=EXAMPLE_PROMPTS,
455
  inputs=[prompt],
 
 
 
456
  label="Example prompts",
457
  examples_per_page=4,
458
  )
 
3
  import random
4
  import subprocess
5
  import sys
 
 
 
 
 
 
 
 
6
  import spaces
7
  import torch
8
  import gradio as gr
 
190
  @spaces.GPU(duration=_duration, size="xlarge")
191
  def generate(
192
  prompt,
193
+ negative_prompt="",
194
+ model="Turbo",
195
+ steps=8,
196
+ guidance=0,
197
+ width=1024,
198
+ height=1024,
199
+ seed=42,
200
+ randomize=False,
201
  progress=gr.Progress(track_tqdm=True),
202
  ):
203
  if not prompt or not prompt.strip():
 
362
  .gradio-container .prose a { color: """ + KREA_ACCENT + """; }
363
  """
364
 
365
+ with gr.Blocks(title="Krea 2") as demo:
366
  with gr.Column(elem_id="page"):
367
  gr.HTML(
368
  """
 
443
  else:
444
  # No bundled sample images present; show the prompts as text.
445
  gr.Examples(
446
+ fn=generate,
447
  examples=EXAMPLE_PROMPTS,
448
  inputs=[prompt],
449
+ outputs=[output, seed],
450
+ cache_examples=True,
451
+ cache_mode="lazy",
452
  label="Example prompts",
453
  examples_per_page=4,
454
  )
diffusers-0.39.0.dev0-py3-none-any.whl DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:a0593cfc51465e7414e1dc2c4c6acdf14fadc4e346d49a19d6116e2d50adf856
3
- size 5594675
 
 
 
 
requirements.txt CHANGED
@@ -1,3 +1,4 @@
1
  transformers>=4.57.0
2
  accelerate
3
  sentencepiece
 
 
1
  transformers>=4.57.0
2
  accelerate
3
  sentencepiece
4
+ git+https://github.com/huggingface/diffusers.git