Import torch from diffusers import StableDiffusionPipeline
![import torch
from diffusers import StableDiffusionPipeline
# Load the model
model_id = "CompVis/stable-diffusion-v1-4"
device = "cuda" if torch.cuda.is_available() else "cpu"
pipe = StableDiffusionPipeline.from_pretrained(model_id)
pipe.to(device)
# Define the prompt
prompt = "A black cat with a dark background, standing on two legs, hanging a rifle gun on its front, wearing a golden necklace"
# Generate the image
image = pipe(prompt).images[0]
# Save the image
image.save("generated_black_cat.png")
print("Image generated and saved as 'generated_black_cat.png'")](https://image.cdn2.seaart.me/2024-06-21/cpqgmode878c73cu8hjg/471883178cf08a0bdddd09440c861620e79b37fa_high.webp)
import torch from diffusers import StableDiffusionPipeline # Load the model model_id = "CompVis/stable-diffusion-v1-4" device = "cuda" if torch.cuda.is_available() else "cpu" pipe = StableDiffusionPipeline.from_pretrained(model_id) pipe.to(device) # Define the prompt prompt = "A black cat with a dark background, standing on two legs, hanging a rifle gun on its front, wearing a golden necklace" # Generate the image image = pipe(prompt).images[0] # Save the image image.save("generated_black_cat.png") print("Image generated and saved as 'generated_black_cat.png'")
プロンプト
プロンプトをコピー
import torch
from diffusers import StableDiffusionPipeline
# Load the model
model_id = "CompVis/stable-diffusion-v1-4"
device = "cuda" if torch
.
cuda
.
is_available() else "cpu"
pipe = StableDiffusionPipeline
.
from_pretrained(model_id)
pipe
.
to(device)
# Define the prompt
prompt = "A black cat with a dark background
,
standing on two legs
,
hanging a rifle gun on its front
,
wearing a golden necklace"
# Generate the image
image = pipe(prompt)
.
images[0]
# Save the image
image
.
save("generated_black_cat
.
png")
print("Image generated and saved as 'generated_black_cat
.
png'")
情報
Checkpoint & LoRA

Checkpoint
CyberRealistic
#エピックキャラクター
#ファーリー
コメント:0件
0
0
0