Skip to content

Conversation

@ppbrown
Copy link
Contributor

@ppbrown ppbrown commented Jan 10, 2026

Make the code examine input model shape to infer actual max token len,
rather than forcing CLIP default of 77.
Update feature_extractor to use AutoImageProcessor, because old code use caused problems.

@yiyixuxu and @asomoza

Fixes #11285

I tested the code by running the following script, and then generating an image from the resulting diffusers-format model.

# run in "scripts" dir
MDIR=~/models

HF=opendiffusionai/xllsd-alpha1
SRCMDL=$MDIR/xllsd
DESTCHKP=$MDIR/xllsd.safetensors
MDL=$MDIR/xllsd-new
if ! test -d $SRCMDL ; then
	mkdir -p $SRCMDL
	hf download --local-dir $SRCMDL $HF
fi

if test -f $DESTCHKP; then
	echo $DESTCHKP already exists
else
python convert_diffusers_to_original_stable_diffusion.py \
--use_safetensors \
--model_path $SRCMDL \
--checkpoint_path $DESTCHKP
fi

python convert_original_stable_diffusion_to_diffusers.py \
 --from_safetensors --to_safetensors \
 --dump_path $MDL \
 --checkpoint_path $DESTCHKP

Update feature_extractor to use AutoImageProcessor,
because old code use caused problems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

value errors in convert to/from diffusers from original stable diffusion

1 participant