mirror of
https://github.com/modelscope/DiffSynth-Studio.git
synced 2026-03-24 10:18:12 +00:00
update examples
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import torch
|
||||
from diffsynth import ModelManager, FluxImagePipeline
|
||||
from diffsynth import ModelManager, FluxImagePipeline, download_models
|
||||
|
||||
|
||||
download_models(["FLUX.1-dev"])
|
||||
model_manager = ModelManager(torch_dtype=torch.bfloat16, device="cuda")
|
||||
model_manager.load_models([
|
||||
"models/FLUX/FLUX.1-dev/text_encoder/model.safetensors",
|
||||
@@ -9,10 +10,11 @@ model_manager.load_models([
|
||||
"models/FLUX/FLUX.1-dev/ae.safetensors",
|
||||
"models/FLUX/FLUX.1-dev/flux1-dev.safetensors"
|
||||
])
|
||||
|
||||
pipe = FluxImagePipeline.from_model_manager(model_manager)
|
||||
|
||||
torch.manual_seed(6)
|
||||
image = pipe(
|
||||
"Anime style. A girl with long silver hair is under water, wearing a blue dress. Her eyes are blue. Her hair is waving in the water."
|
||||
"A captivating fantasy magic woman portrait set in the deep sea. The woman, with blue spaghetti strap silk dress, swims in the sea. Her flowing silver hair shimmers with every color of the rainbow and cascades down, merging with the floating flora around her. Smooth, delicate and fair skin.",
|
||||
num_inference_steps=30
|
||||
)
|
||||
image.save("image.jpg")
|
||||
image.save("image_1024.jpg")
|
||||
|
||||
Reference in New Issue
Block a user