Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -249,8 +249,8 @@ if torch.cuda.is_available():
|
|
| 249 |
# vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
|
| 250 |
token = os.environ.get("HF_TOKEN") # 从环境变量读取令牌
|
| 251 |
model_path = hf_hub_download(
|
| 252 |
-
repo_id="Menyu/
|
| 253 |
-
filename="
|
| 254 |
use_auth_token=token
|
| 255 |
)
|
| 256 |
pipe = StableDiffusionXLPipeline.from_single_file(
|
|
@@ -260,6 +260,10 @@ if torch.cuda.is_available():
|
|
| 260 |
torch_dtype=torch.float16,
|
| 261 |
)
|
| 262 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 263 |
pipe.to("cuda")
|
| 264 |
|
| 265 |
def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
|
|
@@ -324,9 +328,9 @@ def infer(
|
|
| 324 |
"height": height,
|
| 325 |
"guidance_scale": guidance_scale,
|
| 326 |
"num_inference_steps": num_inference_steps,
|
| 327 |
-
"model": "
|
| 328 |
"use_resolution_binning": use_resolution_binning,
|
| 329 |
-
"PreUrl": "https://huggingface.co/spaces/Menyu/
|
| 330 |
}
|
| 331 |
# Add metadata to the image
|
| 332 |
image_with_metadata = add_metadata_to_image(image, metadata)
|
|
@@ -345,7 +349,7 @@ h1{text-align:center}
|
|
| 345 |
|
| 346 |
with gr.Blocks(css=css) as demo:
|
| 347 |
gr.Markdown("""# 梦羽的模型生成器
|
| 348 |
-
### 快速生成
|
| 349 |
with gr.Group():
|
| 350 |
with gr.Row():
|
| 351 |
prompt = gr.Text(
|
|
|
|
| 249 |
# vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
|
| 250 |
token = os.environ.get("HF_TOKEN") # 从环境变量读取令牌
|
| 251 |
model_path = hf_hub_download(
|
| 252 |
+
repo_id="Menyu/miaomiaoHarem_vPredDogma10", # 模型仓库名称(非完整URL)
|
| 253 |
+
filename="miaomiaoHarem_vPredDogma10.safetensors",
|
| 254 |
use_auth_token=token
|
| 255 |
)
|
| 256 |
pipe = StableDiffusionXLPipeline.from_single_file(
|
|
|
|
| 260 |
torch_dtype=torch.float16,
|
| 261 |
)
|
| 262 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
| 263 |
+
pipe.scheduler.register_to_config(
|
| 264 |
+
prediction_type="v_prediction",
|
| 265 |
+
rescale_betas_zero_snr=True,
|
| 266 |
+
)
|
| 267 |
pipe.to("cuda")
|
| 268 |
|
| 269 |
def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
|
|
|
|
| 328 |
"height": height,
|
| 329 |
"guidance_scale": guidance_scale,
|
| 330 |
"num_inference_steps": num_inference_steps,
|
| 331 |
+
"model": "miaomiaoHarem_vPredDogma10",
|
| 332 |
"use_resolution_binning": use_resolution_binning,
|
| 333 |
+
"PreUrl": "https://huggingface.co/spaces/Menyu/miaomiaoHaremDogma"
|
| 334 |
}
|
| 335 |
# Add metadata to the image
|
| 336 |
image_with_metadata = add_metadata_to_image(image, metadata)
|
|
|
|
| 349 |
|
| 350 |
with gr.Blocks(css=css) as demo:
|
| 351 |
gr.Markdown("""# 梦羽的模型生成器
|
| 352 |
+
### 快速生成 MiaomiaoHarem vPred Dogma 模型的图片""")
|
| 353 |
with gr.Group():
|
| 354 |
with gr.Row():
|
| 355 |
prompt = gr.Text(
|