Reputation: 105
I'm new to this area,
I have installed stable diffusion and then downloaded a model from civitai.com
but when i execute, i'm getting error OSError: Error no file named model_index.json found in directory ./model.
.
Which is expected but I can't find a model_index.json
any model i click download, it download the .safetensor only (for example https://civitai.com/models/352581/vixons-pony-styles)
from diffusers import StableDiffusionPipeline
import torch
pipe = StableDiffusionPipeline.from_pretrained(
"./model", torch_dtype=torch.float16, use_safetensors=True
)
prompt = "cat"
image = pipe(prompt).images[0]
image.save("output_image.png")
Upvotes: 0
Views: 395
Reputation: 1
you can try this:
pipeline = StableDiffusionPipeline.from_single_file(pathToSafetensor)
pipeline.save_pretrained(output_dir)
Upvotes: 0