Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -33,6 +33,15 @@ def feifeimodload():
|
|
33 |
hf_hub_download("aifeifei798/sldr_flux_nsfw_v2-studio", "sldr_flux_nsfw_v2-studio.safetensors"),
|
34 |
adapter_name="sldr_flux_nsfw_v2",
|
35 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
pipe.vae.enable_slicing()
|
37 |
pipe.vae.enable_tiling()
|
38 |
torch.cuda.empty_cache()
|
@@ -41,26 +50,31 @@ def feifeimodload():
|
|
41 |
pipe = feifeimodload()
|
42 |
|
43 |
@spaces.GPU()
|
44 |
-
def infer(prompt="", styles_Radio="(None)",
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
if nsfw_select:
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
adapter_weights=[num_feifei],
|
59 |
-
)
|
60 |
-
pipe.fuse_lora(
|
61 |
-
adapter_name=["feifei"],
|
62 |
-
lora_scale=1.0,
|
63 |
-
)
|
64 |
|
65 |
if Expansion_select:
|
66 |
# Define the replacement string
|
@@ -159,8 +173,8 @@ with gr.Blocks(css=css) as demo:
|
|
159 |
)
|
160 |
# 定义提交按钮
|
161 |
feifei_chat_btn = gr.Button(value="Gen Prompt")
|
162 |
-
|
163 |
-
|
164 |
with gr.Accordion("Advanced Settings", open=False):
|
165 |
|
166 |
seed = gr.Slider(
|
@@ -239,7 +253,7 @@ with gr.Blocks(css=css) as demo:
|
|
239 |
|
240 |
run_button.click(
|
241 |
fn = infer,
|
242 |
-
inputs = [prompt, styles_Radio,
|
243 |
outputs = [result, seed]
|
244 |
)
|
245 |
feifei_chat_btn.click(
|
|
|
33 |
hf_hub_download("aifeifei798/sldr_flux_nsfw_v2-studio", "sldr_flux_nsfw_v2-studio.safetensors"),
|
34 |
adapter_name="sldr_flux_nsfw_v2",
|
35 |
)
|
36 |
+
|
37 |
+
pipe.load_lora_weights(
|
38 |
+
hf_hub_download(
|
39 |
+
"aifeifei798/big-boobs-clothed",
|
40 |
+
"big-boobs-clothed-v2.safetensors",
|
41 |
+
),
|
42 |
+
adapter_name="big-boobs-clothed-v2",
|
43 |
+
)
|
44 |
+
|
45 |
pipe.vae.enable_slicing()
|
46 |
pipe.vae.enable_tiling()
|
47 |
torch.cuda.empty_cache()
|
|
|
50 |
pipe = feifeimodload()
|
51 |
|
52 |
@spaces.GPU()
|
53 |
+
def infer(prompt="", styles_Radio="(None)", feife_select=False, feife_select= True, seed=42, randomize_seed=False, width=1024, height=1024, num_inference_steps=4, guidancescale=3.5, num_feifei=0.35, nsfw_select=False, nsfw_slider=1, progress=gr.Progress(track_tqdm=True)):
|
54 |
|
55 |
+
Duke86Syl_lora_name=[]
|
56 |
+
adapter_weights_num=[]
|
57 |
+
|
58 |
+
if feife_select:
|
59 |
+
Duke86Syl_lora_name.append("feifei")
|
60 |
+
adapter_weights_num.append(num_feifei)
|
61 |
+
|
62 |
+
if bigboobs_select:
|
63 |
+
Duke86Syl_lora_name.append("big-boobs-clothed-v2")
|
64 |
+
adapter_weights_num.append(0.45)
|
65 |
+
|
66 |
if nsfw_select:
|
67 |
+
Duke86Syl_lora_name.append("sldr_flux_nsfw_v2")
|
68 |
+
adapter_weights_num.append(nsfw_slider)
|
69 |
+
|
70 |
+
pipe.set_adapters(
|
71 |
+
Duke86Syl_lora_name,
|
72 |
+
adapter_weights=adapter_weights_num,
|
73 |
+
)
|
74 |
+
pipe.fuse_lora(
|
75 |
+
adapter_name=Duke86Syl_lora_name,
|
76 |
+
lora_scale=1.0,
|
77 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
if Expansion_select:
|
80 |
# Define the replacement string
|
|
|
173 |
)
|
174 |
# 定义提交按钮
|
175 |
feifei_chat_btn = gr.Button(value="Gen Prompt")
|
176 |
+
feife_select = gr.Checkbox(label="FeiFei Expansion")
|
177 |
+
bigboobs_select = gr.Checkbox(label="bigboobs", value=True)
|
178 |
with gr.Accordion("Advanced Settings", open=False):
|
179 |
|
180 |
seed = gr.Slider(
|
|
|
253 |
|
254 |
run_button.click(
|
255 |
fn = infer,
|
256 |
+
inputs = [prompt, styles_Radio, feife_select, bigboobs_select, seed, randomize_seed, width, height, num_inference_steps, guidancescale, num_feifei, nsfw_select, nsfw_slider],
|
257 |
outputs = [result, seed]
|
258 |
)
|
259 |
feifei_chat_btn.click(
|