Seltsames Bild, das aus Pipeline und benutzerdefinierten Lora -Gewichten erzeugt wirdPython

Python-Programme
Guest
 Seltsames Bild, das aus Pipeline und benutzerdefinierten Lora -Gewichten erzeugt wird

Post by Guest »

Ich versuche, DiffusionPipeline zu verwenden, um ein Bild zu generieren Aber das Ergebnis ist seltsam und unterscheidet sich von der gleichen Konfiguration auf civitai,
Image

Image

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")

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post