Replies: 4 comments 1 reply
|
Also, what about the custom scheduler? I want to customize the noise generation during the prediction, not the training. Is there a way to do that? |
|
Hi @youyinnn, |
|
Интересная статья, особенно полезна часть про прямой процесс и добавление шума. Насколько я понимаю, для безусловной генерации текстовый промпт вообще не обязателен — модель может начинать с обычного шума и постепенно восстанавливать изображение, если она обучена на нужном домене. Для быстрого сравнения современных вариантов генерации изображений можно также посмотреть Ranvik, а уже для собственного эксперимента разбираться с scheduler и параметрами шума. Думаю, такой подход удобнее, если задача именно в работе с зашумлёнными изображениями, а не в генерации по текстовому описанию. |
|
For no prompt you don't need a special model. Pass an empty prompt and turn off guidance: from diffusers import StableDiffusionImg2ImgPipeline
import torch
pipe = StableDiffusionImg2ImgPipeline.from_pretrained(
"stable-diffusion-v1-5/stable-diffusion-v1-5", torch_dtype=torch.float16
).to("cuda")
out = pipe(prompt="", image=corrupted, strength=0.5, guidance_scale=1.0).images[0]guidance_scale of 1.0 makes it fully unconditional, and strength sets how far it moves from your input (low stays close, high varies more). That covers variation and reconstruction from a corrupted image. Two variants depending on what you have:
And if you want a truly unconditional pixel model with no text encoder at all, look at DDPMPipeline or DDIMPipeline with something like google/ddpm-celebahq-256. It's the cleanest example to read since there's no prompt path to work around. |
Uh oh!
There was an error while loading. Please reload this page.
Hi there.
I am looking for how to generate an image with an unconditional diffusion manner that is able to provide a noisy image.
Or, as an image task but without a prompt, the prompt requires a trained domain-specific NLP model, I suppose (but it's not available in our case).
Any ideas?
All reactions