AngelBottomless commited on
Commit
cf1a5eb
·
verified ·
1 Parent(s): 33eac3b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -7,13 +7,13 @@ import os, gc, json, random, time
7
  import numpy as np
8
  import torch
9
  import gradio as gr
10
- import spaces # << NEW (ZeroGPU helper)
11
  from torchvision.transforms.functional import to_pil_image
12
  from tqdm import tqdm
13
  from diffusers.models import AutoencoderKL
14
  from transformers import AutoModel, AutoTokenizer
15
  from huggingface_hub import hf_hub_download
16
- import functools # (only if you don't already import it)
17
 
18
  import models # local
19
  from transport import Sampler, create_transport
@@ -21,9 +21,8 @@ from transport import Sampler, create_transport
21
  # ------------------------------------------------------------------
22
  # CONSTANTS / ENV CONFIG
23
  # ------------------------------------------------------------------
24
- # --- Hugging Face Hub paths (NEW) ---------------------------------
25
  REPO_ID = "OnomaAIResearch/Illustrious-Lumina-v0.03"
26
- HF_TOKEN = os.getenv("HF_TOKEN") # set in HF “Secrets” tab
27
  CKPT_FILE = "consolidated_ema.00-of-01.pth"
28
  ARGS_FILE = "model_args.pth"
29
 
@@ -191,14 +190,14 @@ with gr.Blocks() as demo:
191
 
192
  with gr.Row():
193
  with gr.Column(scale=2):
194
- prompt = gr.Textbox(label="Prompt")
195
- negative_prompt = gr.Textbox(label="Negative prompt")
196
  system_type = gr.Dropdown(choices=["align","base","aesthetics","real","4grid","tags","empty"],
197
- value="real", label="System prompt")
198
  resolution = gr.Dropdown(choices=["1024x1024","1280x768","768x1280","1536x1024","1024x1536"],
199
  value="1024x1024", label="Resolution")
200
  solver = gr.Dropdown(choices=["dpm","euler","midpoint","heun","rk4"],
201
- value="dpm", label="Solver")
202
  run_btn = gr.Button("Generate", variant="primary")
203
  with gr.Column(scale=1):
204
  guidance_scale = gr.Slider(1.0, 15.0, step=0.5, value=4.0, label="CFG scale")
 
7
  import numpy as np
8
  import torch
9
  import gradio as gr
10
+ import spaces
11
  from torchvision.transforms.functional import to_pil_image
12
  from tqdm import tqdm
13
  from diffusers.models import AutoencoderKL
14
  from transformers import AutoModel, AutoTokenizer
15
  from huggingface_hub import hf_hub_download
16
+ import functools
17
 
18
  import models # local
19
  from transport import Sampler, create_transport
 
21
  # ------------------------------------------------------------------
22
  # CONSTANTS / ENV CONFIG
23
  # ------------------------------------------------------------------
 
24
  REPO_ID = "OnomaAIResearch/Illustrious-Lumina-v0.03"
25
+ HF_TOKEN = os.getenv("HF_TOKEN")
26
  CKPT_FILE = "consolidated_ema.00-of-01.pth"
27
  ARGS_FILE = "model_args.pth"
28
 
 
190
 
191
  with gr.Row():
192
  with gr.Column(scale=2):
193
+ prompt = gr.Textbox(label="Prompt", value="1girl, kita ikuyo, bocchi the rock!, solo, backlighting, blurry, depth of field, bloom, light particles, transparent, blurry foreground, indoors, upper body, red hair, yellow flower, school uniform, white shirt, hair between eyes, lily \(flower\), floating hair, serafuku, chromatic aberration, white lily, green eyes, looking at viewer, red neckerchief, flower, pink flower, sunlight, day, neckerchief, sailor collar, grey sailor collar, white flower, lens flare abuse, medium hair, holding, closed mouth, one side up, long sleeves, holding bouquet, arms at sides, light smile, shirt, blurry background, bouquet")
194
+ negative_prompt = gr.Textbox(label="Negative prompt", value="mutated, worst quality, blurry, bad anatomy, bad hands")
195
  system_type = gr.Dropdown(choices=["align","base","aesthetics","real","4grid","tags","empty"],
196
+ value="tags", label="System prompt")
197
  resolution = gr.Dropdown(choices=["1024x1024","1280x768","768x1280","1536x1024","1024x1536"],
198
  value="1024x1024", label="Resolution")
199
  solver = gr.Dropdown(choices=["dpm","euler","midpoint","heun","rk4"],
200
+ value="euler", label="Solver")
201
  run_btn = gr.Button("Generate", variant="primary")
202
  with gr.Column(scale=1):
203
  guidance_scale = gr.Slider(1.0, 15.0, step=0.5, value=4.0, label="CFG scale")