Update app.py
Browse files
app.py
CHANGED
|
@@ -25,10 +25,10 @@ def feifeimodload():
|
|
| 25 |
"aifeifei798/DarkIdol-flux-v1", torch_dtype=dtype
|
| 26 |
).to(device)
|
| 27 |
|
| 28 |
-
pipe.load_lora_weights(
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
)
|
| 32 |
pipe.load_lora_weights(
|
| 33 |
hf_hub_download("aifeifei798/sldr_flux_nsfw_v2-studio", "sldr_flux_nsfw_v2-studio.safetensors"),
|
| 34 |
adapter_name="sldr_flux_nsfw_v2",
|
|
@@ -50,14 +50,14 @@ def feifeimodload():
|
|
| 50 |
pipe = feifeimodload()
|
| 51 |
|
| 52 |
@spaces.GPU()
|
| 53 |
-
def infer(prompt="", styles_Radio="(None)", feife_select=False, bigboobs_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 |
-
|
| 60 |
-
|
| 61 |
|
| 62 |
if bigboobs_select:
|
| 63 |
Duke86Syl_lora_name.append("big-boobs-clothed-v2")
|
|
@@ -76,15 +76,15 @@ def infer(prompt="", styles_Radio="(None)", feife_select=False, bigboobs_select
|
|
| 76 |
lora_scale=1.0,
|
| 77 |
)
|
| 78 |
|
| 79 |
-
if feife_select:
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
|
| 89 |
if styles_Radio:
|
| 90 |
style_name = styles_Radio
|
|
@@ -94,16 +94,7 @@ def infer(prompt="", styles_Radio="(None)", feife_select=False, bigboobs_select
|
|
| 94 |
if randomize_seed:
|
| 95 |
seed = random.randint(0, MAX_SEED)
|
| 96 |
generator = torch.Generator().manual_seed(seed)
|
| 97 |
-
|
| 98 |
-
pipe.set_adapters(
|
| 99 |
-
["feifei"],
|
| 100 |
-
adapter_weights=[num_feifei],
|
| 101 |
-
)
|
| 102 |
-
pipe.fuse_lora(
|
| 103 |
-
adapter_name=["feifei"],
|
| 104 |
-
lora_scale=1.0,
|
| 105 |
-
)
|
| 106 |
-
|
| 107 |
image = pipe(
|
| 108 |
prompt = "flux, 8k, ",
|
| 109 |
prompt_2 = prompt,
|
|
|
|
| 25 |
"aifeifei798/DarkIdol-flux-v1", torch_dtype=dtype
|
| 26 |
).to(device)
|
| 27 |
|
| 28 |
+
#pipe.load_lora_weights(
|
| 29 |
+
# hf_hub_download("aifeifei798/feifei-flux-lora-v1.1", "feifei-v1.1.safetensors"),
|
| 30 |
+
# adapter_name="feifei",
|
| 31 |
+
#)
|
| 32 |
pipe.load_lora_weights(
|
| 33 |
hf_hub_download("aifeifei798/sldr_flux_nsfw_v2-studio", "sldr_flux_nsfw_v2-studio.safetensors"),
|
| 34 |
adapter_name="sldr_flux_nsfw_v2",
|
|
|
|
| 50 |
pipe = feifeimodload()
|
| 51 |
|
| 52 |
@spaces.GPU()
|
| 53 |
+
def infer(prompt="", styles_Radio="(None)", feife_select = False, bigboobs_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")
|
|
|
|
| 76 |
lora_scale=1.0,
|
| 77 |
)
|
| 78 |
|
| 79 |
+
#if feife_select:
|
| 80 |
+
# # Define the replacement string
|
| 81 |
+
# replacement = " feifei, A beautiful, 18 yo kpop idol, large-busted Japanese slim girl, with light makeup, gazing deeply into the camera, "
|
| 82 |
+
#
|
| 83 |
+
# # Perform the replacements with re.IGNORECASE
|
| 84 |
+
# prompt = re.sub(r"girl", replacement, prompt, flags=re.IGNORECASE)
|
| 85 |
+
# prompt = re.sub(r"young woman", replacement, prompt, flags=re.IGNORECASE)
|
| 86 |
+
# prompt = re.sub(r"woman", replacement, prompt, flags=re.IGNORECASE)
|
| 87 |
+
# prompt = re.sub(r"model", replacement, prompt, flags=re.IGNORECASE)
|
| 88 |
|
| 89 |
if styles_Radio:
|
| 90 |
style_name = styles_Radio
|
|
|
|
| 94 |
if randomize_seed:
|
| 95 |
seed = random.randint(0, MAX_SEED)
|
| 96 |
generator = torch.Generator().manual_seed(seed)
|
| 97 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
image = pipe(
|
| 99 |
prompt = "flux, 8k, ",
|
| 100 |
prompt_2 = prompt,
|