The application provides an arbitrary style transfer enhancement method, a
computer device and a program product. The method constructs a content-style-style triple
data set, filters candidate samples according to content fidelity, style consistency and aesthetic
score, and obtains high-quality triples. Based on the
data set, an attention block denoising
diffusion model is constructed, a frozen variational
autoencoder is used to
encode an image into a latent space token, and a noisy latent token is generated for denoising generation. In the training stage, the supervision fine-tuning and online
reinforcement learning training of the denoising loss are combined, content rewards and style rewards are introduced, the rewards are embedded through a learnable projection network and injected into the attention block to modulate the denoising process, thereby suppressing artifacts and improving content fidelity and style consistency. In the
inference stage, the input is a to-be-styled image and a style
reference image, and the output is a target styled image. In the case of fewer trainable parameters, single
inference output is supported, and the reference projection is cached to reduce repeated calculation.