Offexb commited on
Commit
aed107f
·
verified ·
1 Parent(s): 3a5f7c8

Upload 7 files

Browse files
Files changed (2) hide show
  1. app.py +5 -0
  2. requirements.txt +0 -1
app.py CHANGED
@@ -1,7 +1,9 @@
1
  import os, random, gc, json, re
2
  from pathlib import Path
 
3
  import gradio as gr
4
  import torch
 
5
  from PIL import Image
6
  from rembg import remove, new_session
7
  from diffusers import (
@@ -361,6 +363,8 @@ with gr.Blocks(title="AI Character Studio ULTRA") as demo:
361
  seed = gr.Number(value=-1, precision=0, label="Seed (-1 = random)")
362
  generate = gr.Button("✨ GENERATE HIGH-QUALITY CHARACTER", variant="primary", elem_id="generate")
363
  clear = gr.Button("Clear GPU Cache")
 
 
364
  status = gr.Textbox(label="System Status", interactive=False)
365
 
366
  with gr.Column(scale=7):
@@ -374,6 +378,7 @@ with gr.Blocks(title="AI Character Studio ULTRA") as demo:
374
  [output, used_seed, prompt_view]
375
  )
376
  clear.click(clear_cache, outputs=status)
 
377
 
378
  if __name__ == "__main__":
379
  demo.queue(max_size=20).launch(css=CSS, theme=gr.themes.Base())
 
1
  import os, random, gc, json, re
2
  from pathlib import Path
3
+ import spaces # must be imported before torch for ZeroGPU startup detection
4
  import gradio as gr
5
  import torch
6
+ from train_style_lora import train_chunk
7
  from PIL import Image
8
  from rembg import remove, new_session
9
  from diffusers import (
 
363
  seed = gr.Number(value=-1, precision=0, label="Seed (-1 = random)")
364
  generate = gr.Button("✨ GENERATE HIGH-QUALITY CHARACTER", variant="primary", elem_id="generate")
365
  clear = gr.Button("Clear GPU Cache")
366
+ train_lora = gr.Button("🔥 TRAIN LORA CHUNK (ZeroGPU)", variant="primary")
367
+ train_status = gr.Textbox(label="LoRA Training Status", interactive=False, lines=3)
368
  status = gr.Textbox(label="System Status", interactive=False)
369
 
370
  with gr.Column(scale=7):
 
378
  [output, used_seed, prompt_view]
379
  )
380
  clear.click(clear_cache, outputs=status)
381
+ train_lora.click(train_chunk, outputs=train_status)
382
 
383
  if __name__ == "__main__":
384
  demo.queue(max_size=20).launch(css=CSS, theme=gr.themes.Base())
requirements.txt CHANGED
@@ -6,7 +6,6 @@ peft>=0.13.0
6
  safetensors>=0.4.5
7
  huggingface_hub>=0.26.0
8
  bitsandbytes>=0.45.0
9
- xformers>=0.0.28; platform_system == "Linux"
10
  gradio>=5.0.0
11
  Pillow>=10.0.0
12
  rembg>=2.0.59
 
6
  safetensors>=0.4.5
7
  huggingface_hub>=0.26.0
8
  bitsandbytes>=0.45.0
 
9
  gradio>=5.0.0
10
  Pillow>=10.0.0
11
  rembg>=2.0.59