はじめに
「fuduki_mix」というモデルを公開してくれている「kotajiro001」さんが新たにSDXL派生モデルとして「haduki_mix」というモデルを公開してくれています。この方は「yayoi_mix」というSD 1.5のモデルも公開してくれています。弥生(やよい:3月)文月(ふづき:7月)、葉月(はづき:8月)と和風月名になっています。Pythonスクリプト
from diffusers import StableDiffusionXLPipeline, DPMSolverMultistepScheduler import torch import os model_id = "hadukiMix_v10.safetensors" pipe = StableDiffusionXLPipeline.from_single_file( f"safetensors/{model_id}", load_safety_checker=False, extract_ema=True, torch_dtype=torch.float16 ) pipe.scheduler = DPMSolverMultistepScheduler.from_config( pipe.scheduler.config, algorithm_type="sde-dpmsolver++", use_karras_sigmas=True) pipe.to("cuda") prompt = "portrait of young japanese girl, 25yo, 8k, detailed, standing on street, smiling, plain white t-shirt, eye level angle" folder_name = os.path.splitext(model_id)[0] os.makedirs(folder_name, exist_ok=False) for i in range(4): seed = 10000 * (i + 1) generator = torch.manual_seed(seed) image = pipe( prompt=prompt, generator=generator, num_inference_steps = 30, width=1152, height=896).images[0] image.save(os.path.join(folder_name, f"seed{seed}.png"))
結果
その他
fuduki_mixとの比較をGoogle Bloggerに載せています。support-touchsp.blogspot.com
お気に入りの1枚(カフェにいる女性)
もう写真と区別がつきません。
from diffusers import StableDiffusionXLPipeline, DPMSolverMultistepScheduler import torch from compel import Compel, ReturnedEmbeddingsType model_id = "hadukiMix_v10.safetensors" pipe = StableDiffusionXLPipeline.from_single_file( f"safetensors/{model_id}", extract_ema=True, variant="fp16", torch_dtype=torch.float16 ) pipe.scheduler = DPMSolverMultistepScheduler.from_config( pipe.scheduler.config, algorithm_type="sde-dpmsolver++", use_karras_sigmas=True ) pipe.to("cuda") base_compel = Compel( tokenizer=[pipe.tokenizer, pipe.tokenizer_2], text_encoder=[pipe.text_encoder, pipe.text_encoder_2], returned_embeddings_type=ReturnedEmbeddingsType.PENULTIMATE_HIDDEN_STATES_NON_NORMALIZED, requires_pooled=[False, True] ) prompt = "beautiful japanese woman with smile, 35yo+++, in the cafe, sitting on the sofa, 8k, RAW photo, (best quality)+, masterpiece, photo-realistic, focus, professional lighting" negative_prompt = "(worst quality)++, (low quality)++" conditioning, pooled = base_compel(prompt) negative_conditioning, negatice_pooled = base_compel(negative_prompt) seed =12000 generator = torch.manual_seed(seed) image = pipe( prompt_embeds=conditioning, pooled_prompt_embeds=pooled, negative_prompt_embeds=negative_conditioning, negative_pooled_prompt_embeds=negatice_pooled, generator=generator, num_inference_steps=30, width=1152, height=896, ).images[0] image.save(f"seed{seed}.png")