by Guest » 25 Jan 2025, 13:43
Ich versuche, DiffusionPipeline zu verwenden, um ein Bild zu generieren
Aber das Ergebnis ist seltsam und unterscheidet sich von der gleichen Konfiguration auf civitai,
Ich glaube, das Problem muss auf meiner Seite liegen, aber ich konnte nicht sagen, welcher Teil falsch ist . Weiß es jemand?
Habe mein Skript angehängt.
Code: Select all
#!/usr/bin/env python3.10
import torch
from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler
pipe = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float32)
pipe.load_lora_weights("jennlaw_v1.1.safetensors", adapter_name="faceTest", weight_name="faceTest")
pipe.set_adapters(['faceTest'], adapter_weights=[0.75])
pipe.to('mps')
pipe.fuse_lora(lora_scale=0.75)
pipe.enable_attention_slicing()
pipe.unet.config.clip_skip = 2
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.config)
prompt = "cinematic photo of jennlaw, studio quality, woman standing in a room, blur the background, smiling, having a positive face, wearing a v-neck black sweater, jennlaw, detailed lips, blonde, "
negative_prompt = "asian, chinese, busty, teeth, cartoon, painting, illustration, (worst quality, low quality, normal quality:2), (moles:1.1),"
images = pipe(prompt,
negative_prompt=negative_prompt,
guidance_scale=5,
num_inference_steps=31,
width=768,
height=1024,
generator=torch.manual_seed(2721872758),
num_images_per_prompt=2).images
for idx, img in enumerate(images):
img.save(f"outputs/{idx}.jpg")
Ich versuche, DiffusionPipeline zu verwenden, um ein Bild zu generieren
[list]
[*]Basismodell ist SD 1.5
[*]Lora-Gewichte geladen von https://civitai.com/models/111828/jennifer-lawrence
[*]Läuft auf Mac M3 Max
[*]Eingabeaufforderung, negative Eingabeaufforderung, Startwert, Clip-Überspringen und andere Dinge werden von https://civitai.com/images/1619242 kopiert
[/list]
Aber das Ergebnis ist seltsam und unterscheidet sich von der gleichen Konfiguration auf civitai,
[img]https://i.sstatic.net/F0LU872V.jpg[/img]
[img]https://i.sstatic.net/Hxw8n4Oy.jpg[/img]
Ich glaube, das Problem muss auf meiner Seite liegen, aber ich konnte nicht sagen, welcher Teil falsch ist . Weiß es jemand?
Habe mein Skript angehängt.
[code]#!/usr/bin/env python3.10
import torch
from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler
pipe = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float32)
pipe.load_lora_weights("jennlaw_v1.1.safetensors", adapter_name="faceTest", weight_name="faceTest")
pipe.set_adapters(['faceTest'], adapter_weights=[0.75])
pipe.to('mps')
pipe.fuse_lora(lora_scale=0.75)
pipe.enable_attention_slicing()
pipe.unet.config.clip_skip = 2
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.config)
prompt = "cinematic photo of jennlaw, studio quality, woman standing in a room, blur the background, smiling, having a positive face, wearing a v-neck black sweater, jennlaw, detailed lips, blonde, "
negative_prompt = "asian, chinese, busty, teeth, cartoon, painting, illustration, (worst quality, low quality, normal quality:2), (moles:1.1),"
images = pipe(prompt,
negative_prompt=negative_prompt,
guidance_scale=5,
num_inference_steps=31,
width=768,
height=1024,
generator=torch.manual_seed(2721872758),
num_images_per_prompt=2).images
for idx, img in enumerate(images):
img.save(f"outputs/{idx}.jpg")
[/code]