craiyon logo

Anime boy with blue and black hair stands next to a black cat in a vibrant futuristic cyberpunk city with neon lights.

Anime boy with blue and black hair stands next to a black cat in a vibrant futuristic cyberpunk city with neon lights.

import torch from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler # Carica il modello IA ottimizzato per lo stile anime model_id = "cagliostrolab/animagine-xl-3.1" pipe = StableDiffusionXLPipeline.from_pretrained( model_id, torch_dtype=torch.float16, use_safetensors=True ) pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config) pipe.to("cuda") # Prompt dettagliato con le tue caratteristiche (tradotto in inglese per l'IA) prompt = ( "1boy, solo, anime style, masterwork, " "blue and black hair, large blue eyes, " "wearing light blue clothes, " "a black cat sitting next to him, " "standing in front of a highly futuristic city, cyberpunk cityscape, " "transparent glass elevators climbing skyscrapers, moving sidewalks, moving walkways, " "neon lights, advanced technology, cinematic lighting, highly detailed" ) # Elementi da evitare per mantenere alta la qualitĂ  negative_prompt = ( "lowres, bad anatomy, bad hands, text, error, missing fingers, " "extra digit, fewer digits, cropped, worst quality, low quality, " "historical buildings, old cars" ) # Generazione dell'immagine (formato orizzontale per mostrare la cittĂ ) image = pipe( prompt=prompt, negative_prompt=negative_prompt, width=1216, height=832, guidance_scale=7.5, num_inference_steps=30 ).images[0] # Salva l'immagine sul tuo computer image.save("ragazzo_anime_futuristico.png") print("Immagine creata con successo e salvata come 'ragazzo_anime_futuristico.png'!") See more