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 an AK-47 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/cpqgqf5e878c73cui1bg/c0032d6d3a4eab45ba7af57b3af79b05fa1e9a8e_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 an AK-47 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'")
프롬프트
Copy prompts
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 an AK-47 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