Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,8 @@ import torch
|
|
6 |
from diffusers import DiffusionPipeline, AutoencoderTiny
|
7 |
from huggingface_hub import hf_hub_download
|
8 |
|
|
|
|
|
9 |
def feifeimodload():
|
10 |
|
11 |
dtype = torch.bfloat16
|
@@ -36,7 +38,11 @@ def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, num_in
|
|
36 |
if randomize_seed:
|
37 |
seed = random.randint(0, MAX_SEED)
|
38 |
generator = torch.Generator().manual_seed(seed)
|
39 |
-
|
|
|
|
|
|
|
|
|
40 |
image = pipe(
|
41 |
prompt = "flux, 8k, ",
|
42 |
prompt_2 = prompt,
|
@@ -85,7 +91,13 @@ DarkIdol-flux is a text-to-image AI model designed to create aesthetic, detailed
|
|
85 |
container=False,
|
86 |
value="",
|
87 |
)
|
88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
run_button = gr.Button("Run")
|
90 |
|
91 |
result = gr.Image(label="Result", show_label=False,height=520)
|
|
|
6 |
from diffusers import DiffusionPipeline, AutoencoderTiny
|
7 |
from huggingface_hub import hf_hub_download
|
8 |
|
9 |
+
import config
|
10 |
+
|
11 |
def feifeimodload():
|
12 |
|
13 |
dtype = torch.bfloat16
|
|
|
38 |
if randomize_seed:
|
39 |
seed = random.randint(0, MAX_SEED)
|
40 |
generator = torch.Generator().manual_seed(seed)
|
41 |
+
if styles_Radio:
|
42 |
+
style_name = styles_Radio
|
43 |
+
for style in config.style_list:
|
44 |
+
if style["name"] == style_name:
|
45 |
+
prompt = style["prompt"].replace("{prompt}", prompt)
|
46 |
image = pipe(
|
47 |
prompt = "flux, 8k, ",
|
48 |
prompt_2 = prompt,
|
|
|
91 |
container=False,
|
92 |
value="",
|
93 |
)
|
94 |
+
styles_name = [style["name"] for style in config.style_list]
|
95 |
+
styles_Radio = gr.Dropdown(
|
96 |
+
styles_name,
|
97 |
+
label="Styles",
|
98 |
+
multiselect=False,
|
99 |
+
value="(None)",
|
100 |
+
)
|
101 |
run_button = gr.Button("Run")
|
102 |
|
103 |
result = gr.Image(label="Result", show_label=False,height=520)
|