Qrange-group / SUR-adapter

ACM MM'23 (oral), SUR-adapter for pre-trained diffusion models can acquire the powerful semantic understanding and reasoning capabilities from large language models to build a high-quality textual semantic representation for text-to-image generation.
MIT License
111 stars 2 forks source link

没有获得预期的结果 #11

Open laoniandisko opened 2 months ago

laoniandisko commented 2 months ago

使用的推理代码如下,权重使用https://drive.google.com/drive/folders/1UyC9_AqTezmHXmj4dh0A-9RBKKx_JmJZ import os os.environ['CUDA_VISIBLE_DEVICES']='0'

from SUR_adapter_pipeline import SURStableDiffusionPipeline import torch from SUR_adapter import Adapter

adapter_path = "adapter_checkpoint.pt" adapter=Adapter().to("cuda") adapter.load_state_dict(torch.load(adapter_path)) adapter.adapter_weight = 0.1

model_path = "runwayml/stable-diffusion-v1-5" pipe = SURStableDiffusionPipeline.from_pretrained(model_path, adapter=adapter) pipe.to("cuda") pipe.safety_checker = lambda images, clip_input: (images, False)

image = pipe(prompt='An aristocratic maiden in medieval attire with a headdress of brilliant feathers').images[0] image.save("output.jpg")

截屏2024-07-19 02 22 10
laoniandisko commented 2 months ago

图片

wtc9806 commented 2 months ago

请问,问题解决了吗?我也遇到了类似的问题,使用开源的模型,adapter.adapter_weight = 0.1,将prompt替换为我数据中的prompt,但是生成的结果是: image

wtc9806 commented 2 months ago

@zhongshsh