Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
fengzch-das
nunchaku
Commits
e129f2fd
Commit
e129f2fd
authored
Apr 19, 2025
by
muyangli
Browse files
move dev scripts
parent
7817854a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
26 deletions
+0
-26
dev-scripts/flux_depth_lora.py
dev-scripts/flux_depth_lora.py
+0
-26
No files found.
dev-scripts/flux_depth_lora.py
deleted
100644 → 0
View file @
7817854a
import
torch
from
diffusers
import
FluxControlPipeline
from
diffusers.utils
import
load_image
from
image_gen_aux
import
DepthPreprocessor
pipe
=
FluxControlPipeline
.
from_pretrained
(
"black-forest-labs/FLUX.1-dev"
,
torch_dtype
=
torch
.
bfloat16
)
pipe
.
load_lora_weights
(
"black-forest-labs/FLUX.1-Depth-dev-lora"
,
adapter_name
=
"depth"
)
pipe
.
set_adapters
(
"depth"
,
0.85
)
pipe
.
enable_sequential_cpu_offload
()
prompt
=
"A robot made of exotic candies and chocolates of different kinds. The background is filled with confetti and celebratory gifts."
control_image
=
load_image
(
"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/robot.png"
)
processor
=
DepthPreprocessor
.
from_pretrained
(
"LiheYoung/depth-anything-large-hf"
)
control_image
=
processor
(
control_image
)[
0
].
convert
(
"RGB"
)
image
=
pipe
(
prompt
=
prompt
,
control_image
=
control_image
,
height
=
1024
,
width
=
1024
,
num_inference_steps
=
30
,
guidance_scale
=
10.0
,
generator
=
torch
.
Generator
().
manual_seed
(
42
),
).
images
[
0
]
image
.
save
(
"output.png"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment